CSS style sheet changes not appearing (cache issue?) - Printable Version +- MyBB Community Forums (https://community.mybb.com) +-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html) +--- Forum: General Support (https://community.mybb.com/forum-176.html) +--- Thread: CSS style sheet changes not appearing (cache issue?) (/thread-234667.html) |
CSS style sheet changes not appearing (cache issue?) - Meathead40 - 2022-01-11 Hi folks - I made one small change to the extra CSS sheet, however it is not appearing upon load. The change isn't reflected in the /cache folder of the website. I've tried all sorts of browser forced reloads, but the cache isn't changing. I am not using cloudflare. I've already rebuilt the cache through the admin console. Not sure how to force a cache refresh, any suggestions? I am running 1.8.12. RE: CSS style sheet changes not appearing (cache issue?) - Matt - 2022-01-11 What's your URL and what was the change you made? Also you should upgrade as soon as you can, 1.8.12 was released over 4 and a half years ago and there have been 15 security releases since. RE: CSS style sheet changes not appearing (cache issue?) - Crazycat - 2022-01-11 And if you're using nginx, it has a built-in cache. force-reload nginx to clear it RE: CSS style sheet changes not appearing (cache issue?) - Meathead40 - 2022-01-12 I edited the extra.min.css stylesheet (I made one small change to a color hex). I'm paranoid so don't want to share the URL at the moment anyway. I've confirmed that for a brand new user who has never been to my site, the color fix is loaded correctly. My issue is that I can't seem to force a cache reload for those who have already been to the site. I'm not sure if I am using nginx.. I am using shared hosted on bluehost (sorry for the rookie response). Appreciate any guidance.. Is it possible I could fix this by turning off caching age inside the .htaccess file? RE: CSS style sheet changes not appearing (cache issue?) - Crazycat - 2022-01-13 When you make a change in a CSS file, you can force the refresh by appending the src with a variable. Example here: <link type="text/css" rel="stylesheet" href="https://community.mybb.com/cache/themes/theme6/global.min.css?t=1623969169" /> The t=1623969169 is a part forcing the reload, as you can change it without any repercussion on CSS. Or you can add &ver=1234 (or any parameter). Browsers will think it's a new file (as url is different) and then load from server rather than use its cache
RE: CSS style sheet changes not appearing (cache issue?) - Meathead40 - 2022-01-14 Crazycat, thanks for the great help. One more question - which file contains the src that references the CSS files? I've tried to figure out out myself this afternoon to no avail. I did find this thread (https://community.mybb.com/thread-195622.html) but I am just hoping to directly edit whichever file and append with a variable, as you recommended. Thank you for your help. RE: CSS style sheet changes not appearing (cache issue?) - HLFadmin - 2022-01-15 I note that 1.8.29 includes timestamp references in stylesheets. Global.php is the core code that initializes {$stylesheets}, and this line is the one that adds the stamp.
I'm not sure what version introduced timestamp references, but an upgrade, while laborious, has many advantages. Pagesource before a global.css edit:
Pagesource after an edit:
Timestamps were introduced in 1.8.27 Comparing global.php versions 1.8.12, .26, and .27 suggests you may be able to achieve the same result by adding this code.
after your version's line 337 which reads This is an untested remedy. There may be other code changes required which support this feature, so be prepared to revert your global.php if it does not work. RE: CSS style sheet changes not appearing (cache issue?) - Meathead40 - 2022-01-15 I implemented your changes exactly as suggested and BOOM - it worked!!!!!!!! *THANK YOU HLFadmin!!* I'm really grateful to have this working. I'll do some additional testing but it's looking good so far. |