Updating CSS on server has no effect


#1

Hi, at first it seemed slightly uncanny:

On a new Kirby 3 installation I updated index.css on the server. Yet, however much I afterwards emptied the browser cache, developer tools in Safari and others were still showing my old CSS - although I checked that the file on the server was indeed the updated one.

Even when I deleted index.css on the server, all browsers (with empty cache) were unwavering and went on showing the deleted CSS file.

My question is: It might well be that I am overlooking something here - but I had the idea that perhaps Kirby is still caching my old CSS. Is that possible, and, if so, where could I empty the cache?

Thanks in advance and all the best,
Julian


#2

Kirby does not cache static files, however your web server might.

What you could try is to request the CSS file from the command line with:

curl https://example.com/path/to/your/index.css

Alternatively, you can use a tool like RESTed, which will internally do pretty much the same.

Do you get the latest version of the file that way?


#3

AFAIK Kirby does not tamper with css files in the assets-folder.


#4

Thanks for the quick answers!

No, in this way the server is still showing the old CSS file.

So it’s the web server, you’re right, of course. Sorry to appear so dumbfounded, but I never had this case before, in quite a lot of years.

Great to know, in any case, that it has nothing to do with Kirby. So I can happily close this topic.

Best,
Julian


#5

I had something similar a few years ago. A few things you could check:

  • Have you uploaded to the correct directory (i.e. not to a staging site or similar)?
  • Do you use symbolic links anywhere? Some web servers don’t update those, so restarting the web server may help.
  • Do you use a service like CloudFlare that has its own caching?

#6

I just checked, and, all too true, the web server is using ‘Varnish-Cache’.

You have to explicitly disable it via htaccess in each directory where you don’t wish to have it. After adding htaccess to my assets/css everything is back to normal.

So thanks again.