Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Add option to disable `auto_clear_cache` #23

Closed
sarangandk opened this issue Nov 29, 2013 · 15 comments
Closed

Feature Request: Add option to disable `auto_clear_cache` #23

sarangandk opened this issue Nov 29, 2013 · 15 comments
Labels
Milestone

Comments

@sarangandk
Copy link

@sarangandk sarangandk commented Nov 29, 2013

I'm using Quick Cache latest version on a very very high traffic site. Without any caching plugins my server will not survive. When I publish a single post then Quick Cache clears all the caches in site instead of only clear that particular post's cache and homepage's cache. Because of that time was peek time, my server was overloaded and everything went down.

Quick Cache: detected changes. Found cache files for this site (auto-clearing).

Why does you plugin reset the caches for whole site when I only publish a single post? I need a solution for this problem.

Please advice.

@sarangandk
Copy link
Author

@sarangandk sarangandk commented Nov 29, 2013

Okay. I just found out that this happens when you create a new post and save it as draft. Publishing a post doesn't give this problem but only when clicking the save as draft button.

@jaswrks
Copy link

@jaswrks jaswrks commented Dec 6, 2013

@sarangandk Thanks for reporting this important issue.

See: https://github.com/WebSharks/Quick-Cache/blob/000000-dev/quick-cache/quick-cache.inc.php#L110

add_action('save_post', array($this, 'auto_purge_post_cache'));
add_action('delete_post', array($this, 'auto_purge_post_cache'));
add_action('clean_post_cache', array($this, 'auto_purge_post_cache'));

The intended behavior is to clear only the cache for the specific Post/Page being saved. This is working as expected in my tests thus far; e.g. I've been unable to reproduce this so far.

However, see: https://github.com/WebSharks/Quick-Cache/blob/000000-dev/quick-cache/quick-cache.inc.php#L121

add_action('create_term', array($this, 'auto_clear_cache'));
add_action('edit_terms', array($this, 'auto_clear_cache'));
add_action('delete_term', array($this, 'auto_clear_cache'));

@sarangandk If you create a new category or tag in the process of creating a new Post/Page; this CAN result in a complete clearing of the cache. Is it possible this is what may have triggered this on your installation?

@ghost ghost assigned raamdev Dec 6, 2013
@sarangandk
Copy link
Author

@sarangandk sarangandk commented Dec 6, 2013

Yes, you were right. This happended because I created a post, created new category and saved as draft.

I have a suggestion: Add an option to completely disable 'complete clearing of the cache' because it costs server resources everytime this happens. Especially for a WordPress photo website which have about 7 million photos and millions of cached files. All other single post cache option is fine and it's important.

Please consider this in future versions. Thanks.

@jaswrks
Copy link

@jaswrks jaswrks commented Dec 6, 2013

@sarangandk Point taken, thank you for the reply and feedback. Happy holidays :-)

@ningnoom
Copy link

@ningnoom ningnoom commented Jan 14, 2014

I have this problem too. "Single post publish and draft = Clearing/ Resets all caches" If i add thumbnail and tag in post Clearing/ Resets all caches but i don't add thumbnail and tag in post caches not clearing.

Help me please.

@Daniel1206
Copy link

@Daniel1206 Daniel1206 commented Mar 30, 2014

Hello Jas,
I read through this post and i tried to apply some changes, the first thing i did was to make sure i don't use a new tag and open new category, my subsequent post remain the same, showing "detected changes. Found cache files for this site (auto-clearing)."

From what i read here, it is supposed to cache the actual published post and maybe home page but with the line in quote above, it seems it's not the normal behaviour.

I am new to this cache plugin and i suck using terms to describe problems like you would do, but i hope you understand my explanation and i hope you respond.

Please reply, i might need some further assistance..

@raamdev raamdev changed the title Single post publish = Clearing/ Resets all caches Feature Request: Add option to disable `auto_clear_cache` Mar 31, 2014
@raamdev
Copy link
Contributor

@raamdev raamdev commented Apr 3, 2014

@Daniel1206 Could you please open a new issue for this?

@raamdev raamdev modified the milestones: Next release, Future Release, Next Release Apr 18, 2014
@raamdev
Copy link
Contributor

@raamdev raamdev commented Jun 12, 2014

@sarangandk @Daniel1206 FYI, the problem with saving as Draft incorrectly clearing the cache was fixed in v140605.


Regarding this feature request to be able to disable auto_purge_cache(): I'm thinking it might be a good idea to have this new option automatically display a Dashboard notification when an auto_clear_cache() event was supposed to take place, but didn't because it was specifically disabled. That way, the site owner will be aware that the cache may be outdated and should be manually wiped.


Moving this to the Future Release milestone.

@raamdev raamdev modified the milestones: Future Release, Next Release Jun 12, 2014
@sarangandk
Copy link
Author

@sarangandk sarangandk commented Jun 12, 2014

Good and thanks.

@raamdev
Copy link
Contributor

@raamdev raamdev commented Sep 26, 2014

@sarangandk writes in #337...

Hello,
I'm a Quick Cache Pro user who uses this plugin in my WordPress site. In some large websites, it's a big process when the plugin auto clears the cache when saving Quick Cache settings, plugin updates, new category created etc.

I have a site which have about 500.000 pages and and about 1.5 million cached pages and when the plugin deletes all these data files automatically, my server always goes down and never wake up because it couldn't handle that such load.

In previous versions of Quick Cache plugin, I normally download them and manually delete the php function which auto-clear the cache. Nowadays It's become more complicated to do that every time new version becomes.

When I need to clear the whole cache, I always do that manually in night times or by shell.

So please add an option where we webmasters completely enable/disable the auto clear function forever, in admin panel or in code before updating the plugin.

Or at least, please tell me how to do that. Please!

Please take this request as very important, because if we say WordPress automatically upgrade to a minor version at night times, then the server will be killed and the who server will go down because of this auto-clear function in a large WP site.


Thank you for the further explanation about why this feature is necessary. I can see with such a large site why you'd want to completely disable the automatic purging routines.

At the very least, I can make it possible to disable these automatic purging routines through a filter, so that you don't have to keep modifying the code after each update.

Let me work on that now. I'll update here when I have more information.

raamdev added a commit to wpsharks/comet-cache-pro that referenced this issue Sep 26, 2014
@raamdev
Copy link
Contributor

@raamdev raamdev commented Sep 26, 2014

This feature has been added to Quick Cache Pro and will go out with the next release.

For full documentation on this feature and how to use it, please see https://github.com/websharks/quick-cache/wiki/Clear-Cache-and-Wipe-Cache-Routines

@raamdev
Copy link
Contributor

@raamdev raamdev commented Sep 26, 2014

Next release changelog:

  • Enhancement (Pro): It is now possible to disable the automatic clear and wipe cache routines. If you have a very large site with many cache files, this feature allows you manual control over when the cache gets cleared or wiped. For complete documentation on this feature, see Quick Cache Wiki - Clear and Wipe Cache Routines. See also #23.
@jaswrks
Copy link

@jaswrks jaswrks commented Sep 26, 2014

Very cool! Love the wiki article too.

Note: These MU-Plugins only disable the automatic routines; the manual Clear Cache button, and the Wipe Cache button in MultiSite environments, still function from the WordPress Dashboard as expected. Also, auto-purge routines still function as expected; i.e., cache files for a Page/Post are still purged when the Page/Post is updated, along with any associated cache files (e.g., Home Page cache file, Posts Page cache file, Category/Tag/Author archive view cache files, etc.).

Nice!

@sarangandk
Copy link
Author

@sarangandk sarangandk commented Nov 12, 2014

In the latest update which is pro version 141110, this fix not working. Today when I changed permalink for a post and saved it. All caches were cleared and server was down! :-(
2014-11-12 12_02_56-edit post download tamil songs wordpress

@sarangandk
Copy link
Author

@sarangandk sarangandk commented Nov 19, 2014

For unknown reason, it didn't worked after I upgraded to the latest version 141110. I tried to restore all settings to default and everything works fine now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants