|
Posted by Rik Wasmus on October 16, 2007, 10:53 am
Please log in for more thread options
> Can I force the client to stop caching old stylesheets and javascript?=
>
> In my dynamic web-site, I need to force the client to stop caching old=
> versions of my stylesheets and javascript. Can I do this by including
> a querystring with the url with each external stylesheet and script
> file declaration?
>
> For example:
>
> <link type=3D"text/css" rel=3D"stylesheet" href=3D"../images/menu.c=
ss?
> v=3D1" />
> <script type=3D"text/javascript" src=3D"../javascript/menu.js?v=3D1=
"></
> script>
>
> This is far easier, for me, than coding the web-server to change the
> file headers.
Shouldn't be...
> I just want confirmation that this will work. It seems
> obvious that it should but I'm curious as to why I've never come
> across this technique before.
It works (well, as long as you keep changing the query string), and is =
widely in use.
-- =
Rik Wasmus
|