Current Stylesheet won't load. Stuck in Cache

Using OJS version 3.0.2.0

I uploaded a custom stylesheet. It worked fine. Made a few more changes, uploaded again. Now it won’t load the current stylesheet as if it is pulling the old one from cache.

Things I have tried that have NOT worked:
• Clearing browser cache
• Different browsers
• made another change and uploaded again
• logged out and back in and uploaded again
• clearing the “cache” folder on the server
• manually replacing the stylesheet via ftp

Still it doesn’t seem to recognize the new stylesheet I have uploaded. I thought maybe I wrote bad css or something so I just simply changed a color: #ffffff; value to a color: black; value and then checked the developer tools in the browser and it still had the #ffffff; value.

Am I missing something? How do you clear the cache and force it to load the new stylesheet?

Hi @mbauerCOM,

Have you patched this issue?

I’d suggest starting with that, and to help debug further, work with a browser tool such as Firebug for Firefox. This will show you what CSS rules are being applied, and from what sources.

Regards,
Alec Smecher
Public Knowledge Project Team

Sorry that is a bit over my head I have no idea what that thing you linked to is or how to use it. Is there something to download in there or something? What do I do? How do I engage this “patch?”

In any case it seems I did not describe my issue properly. My CSS values are not being overwritten by other CSS. The issue is my custom stylesheet is not even being recognized by OJS, like it’s not even there.

For example: Here is what is being loaded by the site now:

As you can see I have a custom class called “SliderLink” and it’s being loaded from the stylesheet.css. It has 4 basic values.

However, I go find the stylesheet.css on the server and open it and the .SliderLink values in the stylesheet are as follows:

Notice the “margin-top: 5px;” value. I added that later and the live site is not even noticing that it is there. It seems to have ceased loading the stylesheet and is just permanently using some old cached version.

Hi @mbauerCOM,

This really sounds like a browser cache issue to me – I’d suggest trying to fetch the CSS directly through the web browser to ensure that it’s showing the newest version.

Regards,
Alec Smecher
Public Knowledge Project Team

Only it’s not. That’s what I just described. I HAVE reset the browser cache. I HAVE cleared the cache, tried different browsers, etc. I also HAVE gone through the web browser and checked which version of the stylesheet it’s loading and even after clearing the cache and such it’s still loading an OLD version. That’s what my previous post is describing exactly. I’m 100% positive it is NOT a browser cache issue, I have cleared that a bazillion times. I’ve also cleared the server cache by deleting everything in the “cache” folder on ftp. And yet still, OJS is refusing to load my new custom stylesheet.

Hi @mbauerCOM,

When you upload the revised copy of the stylesheet, does the upload confirm successful completion? Does anything relevant show up in your PHP error log? Have you checked to ensure that the updated version shows up in your public directory (e.g. public/journals/1/styleSheet.css for journal_id=1)?

Regards,
Alec Smecher
Public Knowledge Project Team

When I upload it everything seems fine I don’t see any errors. I have not checked the PHP error log, where is that?

And yes, when I go to public/journals/1/styleSheet.css it shows the current one that has the proper values. I’ve even tried manually updating that via FTP and bypassing the admin panel. Still OJS loads the older one.

I’m starting to feel crazy, I know everything points to it being a browser cache, but I swear I have cleared that several times and confirmed that it is not that.

It seems to be isolated to only that CSS file. Because to get around it, I have been putting my desired CSS changes into the themes CSS file and uploading it via FTP and bypassing the styleSheet.css altogether. That seems to work. It loads those properly.

Hi @mbauerCOM,

The patch I linked to above will change the order of application of stylesheets. If you have two stylesheets (e.g. the uploaded file and a modified theme CSS) that specify slightly different rules, one will take precedence based on the order of loading. The patch, when applied, promotes the stylesheet uploaded in the Appearance form. I’m not sure if this will resolve any confusion.

Regards,
Alec Smecher
Public Knowledge Project Team

Yeah I figured out how to do the patch, it seems to have had no effect whatsoever. It still is not loading the uploaded user CSS. So I’ve cleared it all out and I am now just using theme CSS instead.