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: exp_speedy_tags table not clearing out when static cache is cleared

Status Resolved
Add-on / Version Speedy 1.3.1
Severity
EE Version 5.4.1

Stephen

Mar 11, 2021

Hi Brian,

We’re running into an issue with Speedy and I’m hoping you can clarify if this is an issue or not because it’s been difficult to nail down exactly.

We have a site that is using static caching and where the exp_speedy_tags table has over 200,000 rows in it and the site has been running into strange issues with cache clearing, timeouts, and server errors. We wiped out that table to try to narrow down the issues in a dev environment and after doing that I’ve noticed that when clearing the static cache through the Speedy add-on page in the EE CP that table does not get emptied out. However, using the Speedy cache clearing ACT URL to clear the cache does empty that table. Should that table be emptied out when clearing the Speedy static cache from inside the EE CP?

I’m running into some inconsistent results with cache clearing and I’m wondering if that table might be part of the issue.

Thanks!
Stephen

#1

BoldMinded (Brian)

Hi, Stephen. Are you using flat file caching or static caching with Redis? Getting a look at your config might help.

#2

Stephen

We’re using flat file static caching right now. The speedy lines in our config file are:

$config['speedy_static_enabled'] = 'yes';
$config['speedy_driver'] = 'static';

I can see the rows being generated in the exp_speedy_tags table as pages are visited that use templates that have the tags=”” parameter in their exp:speedy:static tags so the rows seem to be created properly, but the only way to clear those rows is to use the ACT url right now.

Thanks! Stephen

#3

BoldMinded (Brian)

So, I’m guessing since it’s a large site, it’s trying to refresh the cached items when you clear them. Does clearing the cache (from the CP button or the ACT url) take a long time? I added a new config option: $config[‘speedy_enable_refresh’] = ‘no’; If you set that in your config it won’t attempt to refresh any of the items, which means the site cache will have to be re-created naturally when people visit pages. I also made the “Clear All” button in the CP call the same cache clearing that the ACT request does, so it’ll clear tags now too.

Can you describe your caching strategy? Why are you wanting to bust the whole cache at once?

#4

BoldMinded (Brian)

Comment has been marked private.

#5

BoldMinded (Brian)

Comment has been marked private.

#6

Stephen

We actually turned off the cache refresh option for each channel because we were thinking that might be part of the cause for the server errors, but it might have been related to this exp_speedy_tags table being so large. For now I was just trying to understand how that table could have grow so large and if it should be clearing out when we cleared the cache manually through the CP. We don’t use tags extensively in our cache clearing strategy which is why I’m not sure how that table grew so large. We’re mostly using URL based cache clearing and the only reason I’m clearing the entire cache now is for testing to narrow down any other cache clearing issues.

Clearing the cache from the CP button wasn’t taking too long, but clearing it from the ACT url would actually never finish because it kept running out of memory even with the PHP memory limit set pretty high. It’s completing now that the exp_speedy_tags table is much smaller and runs quickly.

Thanks for adding in the new config option to enable refresh globally and making the Clear All button in the CP call the same cache clearing that the ACT request does. Should clearing just the Static cache through the CP also clear out the exp_speedy_tags table or should the Clear All button be the only one that does that?

Thanks! Stephen

#7

BoldMinded (Brian)

So even if you didn’t enable refreshing for channels and used the act url, it was still trying to refresh everything, which is why I added that new config option. Hopefully both are fast now and both do clear all the tags. Let me know how that new build works.

#8

Stephen

Got it. The new build is working great so far in dev. I’ll let you know if we run into any issues with it in production.

Last question is about the difference between the Speedy cache clearing options in the control panel. Should clearing just the Static cache through the CP under the “Clear Driver” section also clear out the exp_speedy_tags table or should the Clear All button be the only one that does that?

#9

BoldMinded (Brian)

It’s kind of a tough one b/c tags aren’t bound to a specific driver. You could use 3 different drivers on the same site and they could share tags, so I’m not sure it makes sense to clear tags when clearing a specific driver. It does make sense though after hearing your scenario that the “Clear All” button behave similarly to ACT url, which is why I made the change so they both do the same thing.

#10

Stephen

That makes sense. Thanks!

#11

BoldMinded (Brian)

I’ll keep this ticket open for awhile. If I don’t hear anything in a couple weeks I’ll close it out. Hopefully this new build helps a lot 😊

#12

Stephen

Hi Brian,

Just wanted to report back that this is all working great.

I am running into another error though with the static cache configuration and I’m not sure if it’s related to this build or not. Let me know if you want me to open a new ticket about this so it’s easier for you to track.

I had added some Ignored URLs to the Static Drive Configuration by following these steps:

  1. Going to the Speedy settings page
  2. Clicking on the gear icon in the Static row
  3. Clicking on “Add New URL” and adding two Ignored URLs to the list

After testing those ignored URLs out, I followed the same steps as above, but removed both lines because they were no longer needed. After clicking the trash can icon to remove the last line, the page returned the following error:

Fatal error: Uncaught TypeError: Argument 1 passed to BoldMinded\Cache\Service\Drivers\StaticDriver::configure() must be of the type array, null given, called in /server/path/system/user/addons/speedy/Service/DriverFactory.php on line 114 and defined in /server/path/system/user/addons/speedy/Service/Drivers/StaticDriver.php:36 Stack trace: #0 /server/path/system/user/addons/speedy/Service/DriverFactory.php(114): BoldMinded\Cache\Service\Drivers\StaticDriver->configure() #1 /server/path/system/user/addons/speedy/mcp.speedy.php(928): BoldMinded\Cache\Service\DriverFactory->getDriver() #2 /server/path/system/user/addons/speedy/mcp.speedy.php(967): Speedy_mcp->getSupportedDriver() #3 /server/path/system/user/addons/speedy/mcp.speedy.php(489): Speedy_mcp->getSupportedConfigurableDriver in /server/path/system/user/addons/speedy/Service/Drivers/StaticDriver.php on line 36

I get this error now whenever trying to go to the Speedy add on page in the Control Panel. I’ve reproduced this same result in 2 different server environments and on my local. The error only occurs after deleting the final row in the Ignored URLs table.

Thanks, Stephen

#13

BoldMinded (Brian)

Instead of sending a whole new build, add this conditional to line 530 of mcp.speedy.php just after the $validate = $form->validate($configuration); line

if (!isset($configuration->settings)) {
                $configuration->settings = [];
            }
#14

Stephen

Great, thanks! That seems to fix this issue. No other issues with this build so far.

Login to reply