keycdn / cache-enabler

A lightweight caching plugin for WordPress that makes your website faster by generating static HTML files.
https://wordpress.org/plugins/cache-enabler/
123 stars 46 forks source link

unnecessary updates to the advanced cache settings #97

Closed atomGit closed 4 years ago

atomGit commented 4 years ago

CE 1.4.1 WP 5.5

i run ConfigServer on the server and use it to monitor for changed files - since the 1.4.1 update, i'm getting notices of changes to /cache-enabler/settings/cache-enabler-advcache-.json every few minutes, yet there seems to be no changes made to the file

this was not the case with the previous version

possible bug?

coreykn commented 4 years ago

To confirm, the file name is cache-enabler-advcache-<domain>.json and not cache-enabler-advcache-.json, right? In version 1.4.0 (PR #92) we moved the advanced cache settings file(s) from wp-content/cache to wp-content/plugins/cache-enabler/settings.

Since version 1.4.0 the advanced cache settings file is created when the Cache Enabler plugin is activated or when a new site is added to a network. It is updated when the Cache Enabler settings are saved, any post type has been scheduled to be posted, or if the permalink structure changes. It is recreated if the Cache Enabler plugin has been updated. It is deleted when the Cache Enabler plugin is deactivated or when a site is deleted from a network.

atomGit commented 4 years ago

hi Corey - first of all the title of the OP wasn't descriptive - i was in a hurry

secondly, i'm no longer sure which file is being changed - all i know at this point is that one of the files is being constantly updated

whitelisting cache-enabler-advcache-.json didn't stop the CSF notices - i eventually whitelisted all of the /cache-enabler files in order to stop the flood of emails

although i'm unsure as to what file is changing in the /cache-enabler directory, it seems to me that none of these files should be changing

these changes have nothing whatsoever to do with me changing settings to the plugin or permalinks - there is a file in the plugin directory that, according to CSF, is being changed every few minutes without any interaction form me - i'm not sure if a file is being written to or if the date is being changed, but something is surely being changed else CSF wouldn't be complaining

coreykn commented 4 years ago

Since version 1.4.0 the advanced cache settings file naming format is as follows:

It's normal behavior for the advanced cache settings file to be changed. You can safely whitelist wp-content/plugins/cache-enabler/settings as the file(s) in this folder can be changed.

atomGit commented 4 years ago

i get that the files in /settings can change if one makes a change to the plug's settings in the WP back-end, what i'm not understanding is why cache-enabler-advcache--.json is changing on a regular basis (yet the file content remains the same) when the plugin settings are not changed

if it's supposed to be this way, fine, i'm just alerting you to this in the event it might be a bug

coreykn commented 4 years ago

After looking into this more I see now that it would be changed often if your pages are regularly accessed with (or without) a trailing slash. For example, if you have your permalink structure set with a trailing slash (e.g. https://www.example.com/about/) and your page is accessed without a trailing slash (e.g. https://www.example.com/about) the settings would be updated. I see now that this is not the best way to handle this, so I'll update this behavior. Thank you for pointing this out.

atomGit commented 4 years ago

great Cory - thanks - i'll leave this for you to close then