Force css update on refresh

When making visual changes to ASYEU.com, occasionally these changes don’t instantly update on refresh. The CSS loads from the cache rather than the updated version, iOS seems to be the platform most affected.

Solution:

Append a query string to the <link /> element by adding ?v=1 to the end of the stylesheet file href address. This forces the browsers to check for the new version. You don’t have to edit your CSS file name you only have to add ?v=1 to the <link /> element.

<link rel="stylesheet" type="text/css" href="/css/stylesheet.css?v=1" />

You can increase the number every time you make a big styling change or if you find the CSS loading from the cache again.

🤞 it seems to of worked!

Reference:

stackoverflow.com/questions/12717993/stylesheet-not-updating-when-i-refresh-my-site

Find Me

Instagram
Twitter
Email

About

Today I enjoyed is my online notepad of things I’ve learn’t and enjoyed for no one else but me!