Preventing CSS Files From Getting Cached
#3
(2012-06-10, 09:20 PM)Alex Smith Wrote: It may be useful in initial development but you could easily do ctrl + f5 which has your browser request it again anyway. And, on a live site you would want the css to be cached.

I have been looking at this today and i have a question about this. Why would this be a bad idea to do the above? I mean the browser still caches the file and if you dont do a huge amount of updates wouldn't this improve the experience for users?

I mean if you give it a fixed value and not like above with the time() function but instead do something like:

$stylesheets .= "<link type=\"text/css\" rel=\"stylesheet\" href=\"{$mybb->settings['bburl']}/{$page_stylesheet}?vers="001"\" />\n"; 

Looking at this you could probably even make it a plugin to achieve this and simply adjust the number when you need it. After adjusting the css significantly for example.
Reply


Messages In This Thread
RE: Preventing CSS Files From Getting Cached - by anori - 2012-11-06, 01:55 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)