Search
Other Cache Cleaner questions
Forum

Cache cleaner and JCH Optimize

Jip Jonker's Avatar Jip Jonker
Hi! Is there a way to make JCH Optimize clear its cached files (js/css) when we trigger a Cache Cneaner 'Clean cache' action (with the button or on save)?
Peter van Westen's Avatar Peter van Westen ADMIN
JCH Optimize, by default, simply caches to the main cache folder. That folder is emptied when you use Cache Cleaner.
So yes, by default Cache Cleaner will also clear the JCH cache.
Please post a rating at the Joomla! Extensions Directory
Jip Jonker's Avatar Jip Jonker
Hi Peter, thanks for getting back to me. I do think there is more to it...

We use JotCache to cache our website pages. JotCache is cleaned when we trigger Cache Cleaner (right?). But JCH optimize also (besides cache file in the cache folder cache/plg_jch_optimize) uses links in the source code like this:

/media/plg_jchoptimize/cache/css/30bdd0adbed98b595d94b0c2ecb63175_0.css
/media/plg_jchoptimize/cache/js/0a501526ec0b45fe83fedd4dc7ea3d9f_0.js

So these file links are stored in the JotCache cache files. Now when JCH refreshes it's cache new links/files are created but the cache page still tries to load the older files. And then we have no CSS and JS. Let say we have set JotCache to refresh ever 15 minutes. And JCH to cache 60 minutes. Most of the time this will be OK. But when the lifetime of the JCH cache has 2 minutes left, and then we use Cache Cleaner to clean the cache (als JotCache) the site will remain to work fine for 2 minutes. But then we have 13 minutes of working files until JCH recaches.

So to prevent this from happening maybe we could trigger JCH to execute a 'cache clean' like it's button on the first screen of the plugin does. So a setting in Cache Cleaner to trigger this when cache is cleaned. I am not sure if this is technically possible. I thin just clearing the folders (media/plg_jchoptimize) might not be enough. Bit maybe it is... Not sure how JCH handles missing files here. It might trigger a recache?

Do you think I am right about how this works and could cause an issue? I know this is an issue between 'JotCache' and 'JCH' but using Cache Cleaner we could maybe solve this. Unless I am all wrong about this of course 😉
Peter van Westen's Avatar Peter van Westen ADMIN
How JCH deals with missing files is something you need to ask JCH.
All Cache Cleaner does is... well... clean the cache.
It will empty the main cache folder. It also has a built in functionality to purge the JotCache cache.
Again, how what these extensions do after cache is cleaned is outside the scope and control of Cache Cleaner.
Please post a rating at the Joomla! Extensions Directory
Jip Jonker's Avatar Jip Jonker
OK thanks Peter. I will check with JCH about this.
Jip Jonker's Avatar Jip Jonker
Hi Peter!

Would you consider building in an option to trigger JCH to recache when Cache CLeaner is triggered? The develop of JCH optimize wrote to me:

"Other plugins/extensions can trigger the 'onJchCacheExpired' event to have JCH Optimize delete all its cache."

Kind regards,
Jip
Peter van Westen's Avatar Peter van Westen ADMIN
All the onJchCacheExpired trigger does - as far as I can tell from the JCH code - is that it empties the /cache/plg_jch_optimize folder.
But Cache Cleaner already empties the entire cache folder. So I don't see what added benefit this would have.
Please post a rating at the Joomla! Extensions Directory
Jip Jonker's Avatar Jip Jonker
Thanks for looking into this for me. I thought JCH also cached some files in the media folder. But I might be wrong. The thing is, when JCH is activated there are two file links to a combined en optimized CSS and JS files. This point to a file in the media folder. Not the cache. We have seen sites that can not seem to find these files (I think cached pages) resulting in a page without CSS/JS functionality. So that's what I am trying to prevent. I am alo in contact with the JCH optimize creator and he will try to modify the plugin to not only trigger the cleanu of Joomla cache bnut also JotCache cache. That might help. But I think this is more of a cache 'timing' option somehow. Anyway, I think I nee to figure this out with the JCH guy 😉 Again thanks for listening.
Peter van Westen's Avatar Peter van Westen ADMIN
If JCH is caching files to a specific media folder, and you want Cache Cleaner to empty that folder too, just set that up in the Cache Cleaner settings:
docs3.regularlabs.com/cachecleaner
Please post a rating at the Joomla! Extensions Directory
Gregory Roussel's Avatar Gregory Roussel
Hi
As I'm in same situation for JCH
I tried to use the custom folders option, like so :
/media/com_jchoptimize/cache/css
/media/com_jchoptimize/cache/js
But it doesn't work.

So as JCH has a Clean Cache button, I tried with Query URL option, but it said:
Confidential information:
(hidden)


Regards
Peter van Westen's Avatar Peter van Westen ADMIN
What do you mean with "But it doesn't work."?
Try:
/media/com_jchoptimize/cache
Please post a rating at the Joomla! Extensions Directory
Gregory Roussel's Avatar Gregory Roussel
Oh ok
thanks it works
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription