in reply to cache js code, but detect when it's changed?

<script type="text/javascript" src="foo.js?1.0"></script>

Replies are listed 'Best First'.
Re^2: cache js code, but detect when it's changed?
by Chady (Priest) on Oct 06, 2007 at 18:56 UTC

    Some browsers will not correctly cache URLs with a query, it's better to have the version be part of the URL. Here's what I did to one site:

    I have the javascript in a folder called /js/ and I have a symbolic link to that folder with the version number, so the application spits out:

    <script src="/js4/foo.js"></script>

    He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.
    Chady | http://chady.net/
    Are you a Linux user in Lebanon? join the Lebanese GNU/Linux User Group.

      Hey, I am interested in this, do you mind point out the browser that does that? thanks.