On Friday, June 19, 2015 at 12:14:10 PM UTC-4, Thomas Heller wrote: > > >> Cache-control is evil. Users concerned with seeing the most up-to-date >> information know to hit reload (and probably do anyway, just to be sure), >> and there's also the option of AJAX polling for that (or whatever precisely >> sites like Facebook do). >> >> > I don't even .... a wrong Cache-Control will cause problems but > Cache-Control is probably one of the most important headers to set for your > webapp. It is also one of the harder ones to get right but the benefits are > significant. > > As for preventing users from seeing stale CSS/Javascript I'd recommend > serving files with a unique name which changes with each new release. >
Doing that will break bookmarks and deep links! Unless you keep all the old versions around, with ways to get to the newest for users who want to. It's almost always better to rely on the user knowing when to reload (to be sure they have the latest) and when to use the Wayback Machine (for when they specifically want to look at an old version). The latter also works much better if the URL for your page stays stable, so all of its versions are presented with a single timeline on that site. Do what you suggested with *just* the CSS/JS files, maybe, but do not do it with the page itself, or images or other stuff meant for the end user to see! Though then the user will still have stale scripts until they reload and get a new version of the page pointing to the new scripts. Which then means you need to update every HTML file on the site every time you change to a new version of some script, so that it now points to the new scripts ... which is another giant mess that suggests it's better to just keep all of them at stable URLs too and rely on the browser reload button DTRT by checking all assets for 304 Not Modified vs. shiny and new. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.