Re: mod_rewrite Version Control for frequently updated files
I agree file.ext?v=001 is not a nice way to control versions as it defeats the browser cache, but I'm not convinced of the value of using mod_rewrite this way.
You have to update all your pages to the new version number anyway so why not simply upload the changed file as apache-002.js etc, and if you are using Dreamweaver for the project then just renaming the file also updates all the links to it which reduces the risk of you missing one.
Uploading the files with a version number would save the expense of running mod_rewrite, defeats the browser cache the same way and works on hosts that don't allow mod_rewrite for whatever reason.
The only arguments I can think of for using mod_rewrite for this are:
a) You don't need to leave the previous version on the server to cater for any clients that still have the HTML cached but not the file in question.
b) If you are shipping an application it saves the user having to clean up old versions after an upgrade, but then your application may not work with all hosting providers which is why the parameter based versioning is used/works.
Argument a is doubtful as you stated you cache those files forever, therefore if the HTML is cached so should the versioned files.
Argument b above can be ignored unless you decide to limit your applications market.
|