How can I clean out my browser cache?

How does Facebook deal with client Browser cache?

  • Nowadays modern browsers do cache javascript, css, images... I imagine that, when Facebook codebase gets updated, browsers have to download the new code/images, etc. The only bulletproof technique I know is changing filenames constantly to bypass browser's cache. Can anybody drop a word about it? If you don't know how facebook is handling it, I'd be pleased to hear your own solutions.

  • Answer:

    The way you mention (changing the name) is exactly how Rails does it. The asset pipeline will "compile" your assets which means it will concatenate and minifiy your js, for instance, and then create a file called application-<hash based on the contents>.js. Then there are helper methods in ruby that let you specify load application.js here and it will load the correct file with the correct hash. Then when you change the content the compiled file name changes automatically for you. The same thing happens with css, images, fonts, etc. I'm sue Facebook is doing something simple but in PHP.

Benjamin Darfler at Quora Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.