I’m having a big site, with file cache enabled. When there’s not much editing on the website via the panel, the cache can grow quite big. As a result, the cache flush that happens when saving a page in the panel takes up too long and time outs, without having flushed the cache.
Emptying that folder over SSH takes forever too.
Anyone has experienced this before and can help me out please? Thanks!
Not really run into this my self but I know you can flush the cache programatically with cache::flush(); shouldn’t be to hard to make a little dashboard widget & button to flush on demand rather then waiting for a page to be saved. You could probably do it on an admin only route as well, just hit the url in the browser to flush.
I don’t know a huge about about the caching… when you save a page, does it rebuild the cache for that specific page or for every page? Im guessing every page since its taking ages to complete.
I wonder if increasing the amount of ram allocated to php will help.
My thinking is that your splitting the job in two this way. If you flush the cache via the button, then save the page its doing the job in two separate steps rather then a flush and rebuild in one bang.
Adding a button to flush the cache kinda defeats its purpose, no? I’m afraid pushing that button will timeout too, since cache:flush is used by the panel to flush cache too…
I’m thinking the problem has something to do with too much files in a single folder?
I now flush the cache when this problem occurs by SSH-ing into the webserver and deleting everything in the cache folder manually via find -delete which is the fastest way to do it via command in my experience. But it still takes a lot of time…
It’s an annoying problem since it’s basically renders the panel useless when the cache is in this bloated state.
Well, yes, but if the whole cache get’s deleted anyway if the page is updated…doesn’t make such a big difference. And it only affects the first visitor on a page. Maybe not ideal, but then this whole page cache is not ideal.
i would think its actually much faster to just nuke the cache folder from terminal and recreate the empty cache folder with the right permissions immediately after rather then getting it to dig through the contents.
@texnixe, I have even tried setting up memcached, but I can’t get it working somehow. Do you have any experience with this? And tips to debug this? e.g. how can I see what’s inside the memcached “database”?
Well, you can actually run bash scripts from PHP, so if theres a way to stop the default process of cache flushing you could run a bash script from a panel hook on page save to nuke & recreate folder instead (i think… you would need to do it before save, if theres an appropriate hook for that). I have a feeling that might mean tinkering with the source code though.