Coder Social home page Coder Social logo

Comments (13)

WuhuaChen avatar WuhuaChen commented on June 16, 2024

Can you give me the name of the minifying plugin, I may need to test it. Normally, if the plugin works automatically in background, it should not matter. LSCache will only cache the content output to browser, so the content should already been minified.

If you manually minify some specific web pages via a GUI button, and changed some php file souce code, you need to manually purge all litespeed cache as well.

from lscache-joomla.

omikron avatar omikron commented on June 16, 2024

The plugin is JCH Optimize. I am using the PRO version, but I am not sure if the issue is specific to PRO.

The plugin creates cache files containing the minified CSS and JS, but I am not sure how the files are being removed causing the 404 errors. I am not able to replicate it - it happens hours to days after the cache is cleared depending on the website and with no changes in Joomla or to CSS/JS files. I think it could be related to this.

from lscache-joomla.

jimhill10 avatar jimhill10 commented on June 16, 2024

I am having this same issue. For me what happens is that I see broken CSS and javascript on pages. Using the Chome console I then see a variety of 404 errors for missing javascript and css files in the path /media/plg_jchoptimize/cache/_0.css

When I look inside of SH404SEF I then see 404 errors produced in the internal category. On the Chrome console for the broken page it shows a similar URL but since we use a CDN it is the CDN URL.

I have been trying to solve this for several days but it keeps coming back. For now really all I can do is to disable JCH Optimize Pro until I can get it figured out.

In summary, our side uses these extensions and settings:
-URLs are built by SH404SEF
-CSS/JS combining and gzip is by JCH Optimize Pro. This also applies the CDN. When we disable this plugin when then use the CDN extension from NoNumber Extensions.

I was wondering if the CDN was setting a cache expiration header that was causing the cached files to expire. I had an over ride set of one month (of seconds) so I removed that. The problem remained.

I tried various settings in JCH Optimize. I am going to set up my dev server with the CDN to see what I can figure out. For now I had to turn it off.

from lscache-joomla.

WuhuaChen avatar WuhuaChen commented on June 16, 2024

I agree with @omikronThis article shows that jch_optimize will generate js/css file and share these js/css file across different php pages. but jch_optimize also have a combine feature allow small js/css to be combined together. So I guess some shared js/css file have been combined and removed cause some relate cached php web page 404 issue. If manually purged these page's cache, and generate cache again, it will be minify again so problem will gone.
I think, if we have two php web page with exact same content, it should share some js/css file, visit both web page, then enable the combine featue, visit one web page again, to see if those shared js/css file was removed/combined or not.

from lscache-joomla.

omikron avatar omikron commented on June 16, 2024

I am currently testing a website that had been regularly(usually within 12 hours) having this issue - with no changes occurring to files or content and Litespeed cache disabled. I am following the steps from the JCH article to see if it is a similar issue, but so far in over 72 hours, the JS and CSS files have not changed.

@WuhuaChen Yes if two pages have the exact same JSS/CSS files JCH should use the same combined file, however this is really rare because modules, components, etc. on each page loading different JS/CSS.

I will keep testing, but I am still at a loss to what is causing the cached CSS/JS to changed when Litespeed is enabled. I should note that I have about 10+ sites running JCH + Litespeed cache on Wordpress that work fine and do not have this issue.

from lscache-joomla.

WuhuaChen avatar WuhuaChen commented on June 16, 2024

@omikron I setup a testing environment have both LiteSpeed Cache and JCH_Optimize enabled, it works fine together. I'm sure LiteSpeed Cache plugin will not delete any css/js file generated by JCH_Optimize. This article said it might be url rewriting or file permission problem, I'm not sure. Because Litespeed cache on Wordpress has its own html optimze and CDN feature, it will change the output content before it reach browser. but Litespeed cache in joomla will not change output content or js/css file at all.

from lscache-joomla.

jimhill10 avatar jimhill10 commented on June 16, 2024

I had issues with this combo but recently I just changed JCH Optimize to use the "combined files delivery" setting of "Static CSS and javascript" files and not any of the PHP methods and now the issue has gone away. I was seeing 404 errors (reported in SH404SEF) with missing css and js files.

from lscache-joomla.

omikron avatar omikron commented on June 16, 2024

I have tried using the settings "Static CSS and javascript", but this results in the same behavior.

Is there any other suggested CSS/JS minifier that may work better with the Litespeed plugin?

from lscache-joomla.

WuhuaChen avatar WuhuaChen commented on June 16, 2024

I have some user using JCH Optimize without problem I thought maybe they also used CDN, so even some js/css file been deleted the website will still work because CDN still have those js/css file.
could you send me the installation package of you JCH_Optimize to [email protected], if you have a develop site that I can access the admin panel to see the configuration it will be better.

from lscache-joomla.

gundestrup avatar gundestrup commented on June 16, 2024

I can confirm that using JCH optimizer is working perfectly.
I did use CDN, but deselected to use it because of speed of litespeed, and the additional time the SSL handshake took, slowed down my website...
But if the caching time setting is not long for both components (Joomla - global setting, and litespeed caching), and you dont't have a proper cache clearning plugin, you get in to trubble.

from lscache-joomla.

omikron avatar omikron commented on June 16, 2024

I talked to the developer of JCH for their opinion and they said;

Are you using Google fonts on these sites? The plugin generates a different cache file(name) based on the type of browser that accesses the site to reflect the different font type that Google would load for that browser. This would explain why the file name didn't change when cache was deactivated but changed after cache was activated. The Cache plugin probably cached the page that was accessed by a different browser.

JCH Optimize cache is hard-coded to one day and will delete expired cache daily. So if a page was cached by LiteSpeed with a JCH Optimize file that had a few hours left on it, then after it becomes expired and somebody accesses another page that was not cached so allowing the plugin to run, this file gets deleted. When the cached page is accessed, then it breaks because the file that was cached in the page no longer exists.

In Joomla! recently we now clear the page cache whenever the Plugin deletes expired cache and I think that has helped with this issue in Joomla!. In WordPress there is no native cache API. I think we would need to delete anything under the /wp-content/cache/ folder to achieve the same effect here. I will try to implement this for the next version and see how that goes.

I use google fonts on my sites having issues so I think this may be what my problem is. Anyone else using google fonts with JCH & LiteSpeed?

I think the changes they are talking about to JCH would not fix the issue with litespeed because of the way it work right?

from lscache-joomla.

WuhuaChen avatar WuhuaChen commented on June 16, 2024

"In Joomla! recently we now clear the page cache whenever the Plugin deletes expired cache and I think that has helped with this issue in Joomla!" , In LiteSpeed Cache plugin, in Options->Advanced we have a web interface to purge all LiteSpeed Cache, If you can persuade JCH to call this web interface when they clear joomla page cache, I think file missing problem will be solved. I emailed to them but I can't submit ticket so they didn't reply me.
About different browser generate different cache file name, we can add an option to generate different cache copy for different browser in later release, we can handle that.

from lscache-joomla.

uglyeoin avatar uglyeoin commented on June 16, 2024

check this solution too possibly #24 (comment)

from lscache-joomla.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.