le 16.02.2008 03:01 James Brady a écrit: > Hi, I'm researching the best way for me to dynamically add version > numbers to requested static files. > > One of the tips Y Slow (http://developer.yahoo.com/yslow/) gives is to > set distant Expires headers to static files to help caching > performance. > > However, to get round this when a static file changes, you need to > change the file name of that file to force a refetch. > > One approach would be to have some Apache rewrite rules to map > "my_style.v100.css" to "my_style.css" for example, with the CSS > include directives generated dynamically (see > http://particletree.com/notebook/automatically-version-your-css-and-javascript-files/) > > Ideally, what I'd like is the hash of the file included in the > filename, something like that. Has anyone got any tips? > > what about adding the version number (or the update date) as a parameter of the URL like http://server/filename.xxxx?upd=200802161328 (or any format of the update date you can get with the os library) So browsers will refresh the cache only if the parameter changes. You don't need any rewrite rule because apache will not consider the parameter, but you still need to dynamicaly generate the URLs... > Thanks, > James > > > >
--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---

