CSS cache problem

#1
Hi. I'm using PrestaShop 1.6.1.23 and LiteSpeed module.

Before installing ls module, when I add a CSS code to autoload folder, it would load the code with a simple page refresh so my users will always see the last changes. After installing ls module, I found that the user has to press Ctrl+F5 to see the final changes even after I Flush all cached pages from the module configuration page.

So is there any option or solution that will solve this problem? (Refreshing the changed CSS file without Ctrl+f5)

Thanks.
 
#3
Hi @Unique_Eric

Thanks for responding, Apache optimization is On in CCC section (and also I have disabled first two options in that section (CSS/JS cache) because sometimes CSS files can't load properly while this option is enabled)

Best regards.
 

Unique_Eric

Administrator
Staff member
#4
I see, please try turn Apache optimization off.
Restart web server if you can (not a must)

And try reproducing the issue after you clean up all the browser cache from your device.
 
#5
Hi @Unique_Eric

Sorry, it took so long to test your solution. I have enabled module again and turned off the Apache optimization but it's still the same. I add some CSS code to autoload, then "Flush All PrestaShop Pages" using the module but user still should use Ctrl+F5 to see the changes.

Is there any note or other options if you want to mention?

Thanks.
 

Unique_Eric

Administrator
Staff member
#6
Hi @Aminvtn ,

Please visit web admin -> Server -> General -> Expires set to `No`. See if this helps.
If issue still, please send me an url to check, thanks.

Best,
Eric
 
#9
Hi

The problem of custom CSS autoload that needs ctrl+f5 is solved now, I have to turn on the "Smart cache for CSS" and "Smart cache for JavaScript" From CCC section of Advanced Parameters > Performance. Now it combines all CSS files (include the theme and autoloads) and changes the file name after adding new codes.

But there is a problem with CCC and LS. Sometimes (which is random) site doesn't load CSS/js (only pure HTML) and I have to "Flush All PrestaShop Pages" in the Manage tab of the LS module. It's not related to a network problem or server because when LiteSpeed or CCC options are disabled, it doesn't happen. If I turn off those two CCC options for CSS/Js this won't happen but the site will load slower and scores in PageSpeed/Gtmetrix will be so low.

Is there any solution for this?

Best regards.
 
Top