Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: cache js code, but detect when it's changed?

by Chady (Priest)
on Oct 06, 2007 at 18:56 UTC ( #643138=note: print w/ replies, xml ) Need Help??


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

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.


Comment on Re^2: cache js code, but detect when it's changed?
Download Code
Replies are listed 'Best First'.
Re^3: cache js code, but detect when it's changed?
by Cop on Oct 06, 2007 at 19:14 UTC

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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://643138]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (13)
As of 2015-07-07 21:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls