Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Cache clearing on entry save is slow

Status Resolved
Add-on / Version Speedy 1.9.0
Severity
EE Version 7.3.15

Adam Skiles

Mar 19, 2024

I have the default caching driver set to ‘file’ ($config[‘speedy_driver’] = ‘file’;). For Cache Clearing I have the system set up so if any channel is saved it clear all local and global items. While clearing the cache this way DOES work when a channel is saved, it is slow, and depending on how many items are cached sometimes the browser will time out and not clear the cache fully.

Conversely, if I navigate to the add-on, click “View Driver Items” under the “Filesystem” row, and click the “Clear Cache” button from that screen, it is nearly instantaneous regardless of how many items are cached.

I’m not sure why clearing the cache when saving a channel takes so much extra time, but it has become quite a nuisance.

Any help would be much appreciated.

Thanks! Jason

#1

BoldMinded (Brian)

Comment has been marked private.

#2

Adam Skiles

Brian -

Is it possible that it is taking extra time trying to figure out if the other drivers have cache that needs cleared? I came in this morning with just over 300 items cached. When I navigated to the add-on and clicked the “Clear All” button under “Clear All Cache” it took about 25 seconds to clear it. If, however, I select “Filesystem” underneath “Clear Driver”, and click the Clear button, clearing only the driver I’m using (Filesystem), it clears that many items pretty much instantaneously.

I’m assuming that when a page is saved it is running that “Clear All Cache”. Is there any way (even if I need to make a change in the add-on and replicate it after every update) to make it so the Cache Clearing Rules only tries to clear the Filesystem driver and not everything?

Jason

#3

BoldMinded (Brian)

Since you can use multiple drivers at the same time (one default, and then in fragment tags you an specify different drivers) Clear All Cache is going to do just, attempt to clear any driver that is enabled and configured. If Memcached is enabled on your server, even if you’re not using it, it will try to connect and clear cache items. I can’t change it to only clear a specific driver type when an entry is saved for this reason… the entry has no idea what drivers are being used for cached items related to that entry.

#4

BoldMinded (Brian)

Also, if you’re heavily using tags it has to delete rows in the database, which for 300 cache items can take a hot second.

#5

Adam Skiles

Understood - that’s why I was wondering if I could hack the add-on somewhere. I’m the develop and know that I’m only using the Filesystem driver.

Switching gears to a different approach…is there any way to flag a driver as disabled? The add-on shows “available” for Database, Dummy, and Filesystem; “unconfigured” for Memcached and Redis; “unsupposed” for static. I wonder if there was a way to disable drivers so it’s only trying to clear actively used caching methods if that would help.

#6

BoldMinded (Brian)

There isn’t a way to actively disable a driver. Dummy and Database are always on, but if you’re not actively using the Database as a driver, then it should be empty of keys, but it is still used to save tags and such. If it’s “unsupported”, then it shouldn’t be included in any cache clearing attempts.

If you are able to do some debugging or tracing to identify unusual slow points (with supporting metrics) then I can take a look at replicating, but if you modify the add-on to try to further disable things, then I can’t provide additional support.

Login to reply