Why ?fin11 on the end of css links in theme

Started by paulmc, August 16, 2007, 06:21:31 AM

Previous topic - Next topic

paulmc

Hi,

I am helping out with a community website using SMF, streamlining the server, minimising bandwidth and so forth.

I have noticed:
index.template.php:     <script language="JavaScript" type="text/javascript" src="', $settings['default_theme_url'], '/script.js?fin11"></script>
index.template.php:     // The ?fin11 part of this link is just here to make sure browsers don't cache it wrongly.
index.template.php:     <link rel="stylesheet" type="text/css" href="', $settings['theme_url'], '/style.css?fin11" />
index.template.php:     <link rel="stylesheet" type="text/css" href="', $settings['default_theme_url'], '/print.css?fin11" media="print" />';

in smf/Themes/default.

From the comment it seems intentional but I can't imagine why I don't want the js and CSS to be cached (on a dev site maybe, but not on a site where the files aren't changing).

Does anyone know why this is being done? I want to remove the querystring (those files are probably responsible for a gig of traffic a month) but don't want to break anything if there is a good reason for it or something to be aware of.

Ben_S

They should be cached regardless of the querystring, obviously if you change the querystring, it will re-download it.
Liverpool FC Forum with 14 million+ posts.

paulmc

Quote from: Ben_S on August 16, 2007, 07:12:01 AM
They should be cached regardless of the querystring, obviously if you change the querystring, it will re-download it.

I think in practice things aren't that simple. Different browsers (and versions of browsers) and proxies do different things when faced with a resource containing a query string. Some err on the side of caution and consider it dynamic content that will always be changing. I think modern browsers (IE 7 and late Mozillas and Opera) are better and will cache if you send fairly specific headers.

SleePy

Is this issue solved or do you still require assistance?

You are more than welcome to remove it but most browsers will cache it as it sees it as the same url as it had before.
Jeremy D ~ Site Team / SMF Developer ~ GitHub Profile ~ Join us on IRC @ Libera.chat/#smf ~ Support the SMF Support team!

Advertisement: