0

I have a website that has auto-generated CSS filenames. ie: my "custom.css" file gets renamed to "custom.f8c1a0c5.css" whenever I do a deploy of my latest code. The reason for this is to ensure that if a user is viewing my website for the second time he can see the styles and that the page is not broken or left making everything look weird.

However this causes another problem, namely when I view my website via Google Cache it then looks like this: enter image description here How can I ensure that the client always sees the latest CSS when on the website yet at the same time, Google Cache always views a nicely formatted page even when I do another code deploy?

John Crawford
  • 9,656
  • 9
  • 31
  • 42
  • [Google doesn't seem to cache stylesheets](https://webmasters.stackexchange.com/questions/4206/does-google-cache-stylesheets) and [you can modify the path to the CSS to force a reload](https://stackoverflow.com/questions/3870726/force-refresh-of-cached-css-data) – Domino Jun 12 '19 at 15:19
  • @JacqueGoupil I know that Google doesn't cache stylesheets... that is EXACTLY my problem. That is EXACTLY why I don't want to modify the path. Why did you link to an question that is doing EXACTLY what I am currently doing? Please READ my question before responding. And if you don't know the answer don't reply. Simple. – John Crawford Jun 12 '19 at 15:27
  • I'm very sorry, I did misread your question. But it sounds to me like you're inventing yourself a problem that isn't one. Google doesn't cache CSS, so a website will never look good if its original CSS no longer exists at that URL. – Domino Jun 12 '19 at 15:41

0 Answers0