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

Change cache and settings paths #226

Closed Dynamo6Dev closed 3 years ago

Dynamo6Dev commented 3 years ago

It would be great to have a hook to allow me to specify a different cache (and settings) path (e.g. a network location when running a multi-server setup). Thanks

davelit commented 3 years ago

I'd love to see this enhancement too. My use case is that I manage my WordPress install in a git repository and my wp-content folder is write protected.

I think two new constants, for example CACHE_ENABLER_CACHE_DIR and CACHE_ENABLER_SETTINGS_DIR that could be overriden in wp-config.php, would help a lot.

Since this is my first comment on the Cache Enabler project, let me use this opportunity to express my gratitude for the good work you are doing! I'm responsible for a fairly large site (10k daily visits, 12k posts) and have extensively reviewed and tested Cache Enabler, WP Super Cache, and WP Rocket and ended up choosing Cache Enabler in combination with WebP Express.

In case you are interested, here is where the others fell short:

coreykn commented 3 years ago

Thank you both for sharing your request. This would have to be a constant because using a filter hook won't work when the advanced-cache.php is included as it's before many other parts of WordPress start up, and as far as I know it's not possible to register a hook before this.

The names suggested by @davelit would be the names I would use. Adding support for this is okay with me. It will also align with our other definable constant, CACHE_ENABLER_DIR. I should be able to add support for this in the next branch.

@davelit, I really appreciate hearing that. I want to thank you for going into more detail about why Cache Enabler was the solution you've chosen. It's always great learning more about where Cache Enabler stands in the eyes of a user, whether that's praise or criticism.

coreykn commented 3 years ago

@Dynamo6 and @davelit, customizing the cache and settings directory paths is now possible. If one or both of have the chance to test this recent change that'd be appreciated. 🙂