/ Published in: PHP
Expand |
Embed | Plain Text
Comments
Subscribe to comments
You need to login to post a comment.
ashsa on 02/03/11
3 people have marked this snippet as a favorite
Subscribe to comments
You need to login to post a comment.
This is exactly how I did this for quite a while now. Today I think there's better ways to do this: Since modern websites (should) use some sort of JS compression (Minify, Dojo Compressor, Google Closure, etc.) you could as well update the link to the JS file in your HTML document whenever you run the compiler. Thus you can move away this freshness-determination from the Frontend and do that server side. Usually, I use jQuery with some dozen plugins, so I save a dozen file accesses upon request.