Being a total newbie. Style.css updated in cpanel but not in the Browser

I made a “basic” static html and css page. Uploaded it to cpanel with github, it works… But when I now edit and deploy the new versions onto cpanel it updates the .html and css files. The index.html will get changed in the browser but the style.css still is like before the deploy.

Sometimes your browser will cache CSS files, so you don’t see the result of the updated version.
Try clearing your browser cache.

I did, and wouldn’t it cache the index.html otherwise too? Those changes on index.html work

It might or might not. Best place to look is in the console for errors and in the network tab. You can filter in the network tab for css and see if its comming from cache, or if its returning at all

There is one problem with that… Console errors are useless to me because I get at least 5+ request every second for a file that’s currently missing because the new site doesn’t have that part of backend yet. (Every request is another user opening the app for the first time)

Try linking or including the stylesheet and append a parameter which will override the cached stylesheet.

Example:

<link ... 'stylesheet.css?2019-12-25'>

The parameter is best removed after say a month because it will slow page rendering by having to load the CSS file everyone the page is called.

That works until I remove the paramter it reverts after that

When the parameter is removed the browser is reverting back to the cached version.

Selecting the page and refreshing using CTRL-F5 - may clear the cached version otherwise…

The parameter is best removed after say a month because it will slow page rendering by having to load the CSS file everyone the page is called.

1 Like

Oh I think cloudflare caches the style.css file

Cloudflare has a clear/purge cache.

I frequently delete the file, browse to the missing page which deleted the cache then update the page with the latest version.

Is there any reason why the stylesheet filename cannot be renamed?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.