No replies
jaap_nl's picture
Last seen: 9 years 25 weeks ago
Timezone: GMT+1
Joined: 2013-01-21
Posts: 1
Points: 2

Dear reader,

When I change a file like layout.css at my site I want that browsers of visitors use this new css file. This will however not happen automatically since all browsers cache css-files. Of course this question is not new, but I cannot find a clear (read: standard) solution on the internet and on this forum.

Solutions I found:
1. Renaming the css-file. Of course this works but there has to be a better way. In complex websites you can of course rename the css-files one by one by copy and past for example in Dreamweaver, but this is error-prone.

2. Adding a ? extension, so in the case above renaming layout.css to layout.css?version=2. This is less error-prone, since it would mean repaling all .css instances to css?version=2 in the entire site. However, does it always work well? And, when a visitor revisits the site, will it reload a file like layout.css?version=2 every time agian? This is not what you want since it will result in a lot of extra traffic and slow response time of a site.

Can anyone help me out with this?

Thank you in advance,