We are moving to a new web server shortly, and are also optimising our approach to scripts and styles.

This means, among other things, that we have new assets for users to download - and while our new server will deliver better performance, the initial perception might be worse as new files have to be downloaded for the first time.

So, for a better user experience, would it be appropriate to 'drip-feed' assets bit by bit over the next week or two, so that regular visitors will already have these cached in time for the move?


If you can do that, it's always a good step.

Even better, if you can do asynchronous requests for those resources so you don't affect the normal and expected behaviour of your site, it's even better.

But also, inform your users about the situation, may be not about the background download of elements, but the fact that you will be moving to a new server and that you are taking steps to make the transition as smooth as possible, but that they may feel some glitches during that period.

If your community is used to technical terms and would understand what you are doing, then you may consider explaining the whole process on a dedicated page.

  • Thanks, just wondered about the ethics of using <link rel="prefetch" href="http://example.com"> when it's not strictly necessary...yet. – neil Mar 6 '14 at 16:12
  • @neil: Well, I was not referring to using that, although it may work, I was considering doing some "unnecessary" requests with AJAX, so all the HTML + CSS is what the user needs, but once the page is loaded, and not before, you do some extra requests so the resources are already on the cache for the time they are required. Of course you have to be sure that the cache related headers from the server are longer that the time you are going to do the "prefetching" process. – PatomaS Mar 7 '14 at 0:24
  • Yep, JS generally cached for a year (CSS only a month) so should be fine to do week before... – neil Mar 7 '14 at 11:44
  • @neil — Imagine if all sites were doing what PatomaS wants to do. What a horror ! – Nicolas Barbulesco May 4 '14 at 15:48

A safe way would be "wrapping" the resources (prefixes to css-handles, javascript classes/calls) and deploying them via a lazy async javascript loader.

At launch enable all in a high level file which just changes the references for old to new css/js. You just replace the filenames for the new versions in your (I guess optimized) resource loading queue.

It may add a lot of overhead and make the code less clear though, depends on your complexity.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.