So we are doing weekly releases of our project and we are running into problems with clients having old stale versions of certain files.
The stack is backbone with requirejs with backbone boilerplate and an Apache2 server with PHP backend.
We have the index html file that gets loaded, template HTML files that get loaded using AJAX, and then all the js files.
This question seems related to https://stackoverflow.com/questions/12103341/backbone-boilerplate-disable-caching but I didn't see a good answer there.
I've heard that cache-control headers and mod expires and mod headers for PHP might be helpful, but I don't know how to put it all together.
Essentially, what we want to do is make sure on a release of new code to the prod server that everything is not cached at least once. THen after that, normal caching to increase load speed would be ideal.
At the very least, I would liek to understand how to completely prevent these things from being cached.
Any ideas?
With requirejs, there is a parameter called urlargs it adds a parameter to all your requirejs requests and can be employed to force cache update. The example on the page use a timestamp, but you probably looking for a build version.
However, you should use r.js to build a production version of your scripts (it compiles and minifies all files loaded with require and produces a single library). This will reduce load time and save you a lot of worries. You would them link just this one library and have the build version in the file name itself (something like backbone.app.1.0.23456.js).