I'm setting up development environment of Apache. I prefer to set a environment variable to be local checked out SVN revision number. The environment variable value is then read in PHP code and put in external JavaScript and CSS URL (as cache bustor). As a result, every time I "svn up" my local code, I got updated JavaScript and CSS URL related to the revision number.
For example, current revision number is 2314 and set to $_SERVER['REVISION']. The PHP page will read this $_SERVER['REVISION'] and render external JS link like this http://www.example.com/2314/home.js. Since there is a revision number in the URL, if local revision is updated, browser cache will be busted for easy development.
Is it possible to achieve this in Apache?
Thanks,
-Morgan
From reading your answer it sounds like this is a client-side issue. Subversion does not support client-side hooks (from what I know) so I would recommend writing a small script similar to the following to perform your update and also update the revision number in a file.
Then in your php code you can read in the revision number as follows:
I recommend reading the revision number from a file rather than reading from an environment variable. There isn't an easy way to ensure that your current environment is the same a the environment that Apache is running under. Also this ensures that the revision number in the php code survives reboots, etc.
You should set Subversion to ignore the svn-revision file so you aren't checking it in.