Posted 21 July 2010 - 09:34
Using timestamps to indicate versions was a great idea in 1985, but now we're 25 years ahead. Don't use a timestamp for this, that will include dependencies on file system, time zones etc.etc.
QUOTE |
Here is some background on my problem. My installation installs a web server instance with static (say HTML) content files. Client browsers who access static files via the web server cache them. If the application is upgraded the clients don't see new versions of the HTML files since browser updates its cache only in case if the timestamp of the static file is newer than the timestamp of the cached one. In case if somebody accesses the HTML file before installation upgrade she doesn't see the new file version in browser without clearing its cache. |
Your solution does not work in this scenario. Since browsers have no access to the file system of the webserver, it cannot determine whether time/date stamp of the files on the file system changed anyway.
You may want to consider to reduce the cache time to an acceptable length (eg. 1 hour) or to rename all the changed files.