Forum Moderators: open
...to prevent the cache is there code within the js file that ensures this...
Not necessarily... unless there is perhaps some server-side script that returns a "
pragma: no-cache" etc. header?!? But I don't think the idea is to prevent caching.
...or does the browser interpret the timestamp and stops caching the js file?
Like I say, I don't think they are trying to stop the file from being cached, just to pull the latest from the server when it needs to. "main.js?1161990407" will be cached. The '?1161990407' (query string) part is 'ignored' when simply referencing the file from the <script> tag, but is used by the browser to store a reference to the file when it is cached. Every time that timestamp is changed then the idea is the browser won't find a match in the cache so pull another copy from the server. I am assuming that the timestamp is not changing on every refresh?! Perhaps every few days/weeks or so? So the file should be cached in the meantime.