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

Do not clear the post cache if the current_url_supercache_dir matches… #66

Closed
wants to merge 1 commit into from

Conversation

kraftbj
Copy link
Contributor

@kraftbj kraftbj commented Aug 25, 2015

… the supercache_dir.
See #45

@Sophist-UK
Copy link

For clarity, @graphicsxp was referring to #98 which he reported.

@graphicsxp - I think that this does fix the problem of all cache being deleted, but does NOT fix the problem of list pages (like blog pages showing all or specific categories of posts) needing to be invalidated. However this is a new problem which needs investigating.

@graphicsxp
Copy link

ok then :) So it is not normal behaviour ?

@Sophist-UK
Copy link

Actually,now I have reviewed the code again, I am not sure that this is the fix that is needed.

Function prune_super_cache is the routine which prunes the cache and it recursively prunes all subdirectories. This works for simple blogs where the category list has the posts in subdirectories, but is overkill for hierarchical pages (i.e. deletes too many pages), and can easily be incomplete i.e. it doesn't do archives, it doesn't do pages which e.g. use the list-category-posts plugin etc.

I think we should move this discussion to #98.

donnchawp added a commit that referenced this pull request Oct 24, 2017
Fixes #45
If a custom post type has no rewrite permalink then the plugin will
clear the entire cache in wp_cache_post_id_gc() because
get_current_url_supercache_dir() will strip the ?x=y from the URL,
resulting in the URL being the homepage. The plugin then deletes
everything below that.
See also #66
donnchawp added a commit that referenced this pull request Oct 25, 2017
Fixes #45
If a custom post type has no rewrite permalink then the plugin will
clear the entire cache in wp_cache_post_id_gc() because
get_current_url_supercache_dir() will strip the ?x=y from the URL,
resulting in the URL being the homepage. The plugin then deletes
everything below that.
See also #66
@donnchawp
Copy link
Contributor

A similar check was added in #420. Closing this.

@donnchawp donnchawp closed this Oct 25, 2017
@donnchawp donnchawp deleted the fix/issue-45 branch October 25, 2017 12:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants