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

Ability to define how long to keep cached files #250

Closed
fliespl opened this issue May 6, 2019 · 6 comments

Comments

Projects
None yet
2 participants
@fliespl
Copy link

commented May 6, 2019

We would like to be able to keep old cache files (for defined length of time) so that google cache has access to them if it has very old html page cached.

In our case html cache had links to plenty of css files which were already deleted?

It would be great if such feature could be added.

@futtta

This comment has been minimized.

Copy link
Owner

commented May 6, 2019

But AO doesn't clear it's own cache (for many a reason), so the solution would be not to clear the cache? Alternatively you could use a file manager (plugin, in a cpanel-like environment or using (s)ftp) to find and delete older files.

@fliespl

This comment has been minimized.

Copy link
Author

commented May 6, 2019

Thanks! I was under the impression it does :)

Thanks for explanation! Will just block clear cache button pragmatically so no-one can click it by mistake.

@futtta futtta closed this May 6, 2019

@fliespl

This comment has been minimized.

Copy link
Author

commented May 20, 2019

Hi @futtta,
I am coming back with this one.

I think that it's clearing cache if other caching plugin uses purge cache option - in our cache w3 total cache.

I am basing my assumption based on this part of the code:

            $page_cache_purge_actions = array(
                'after_rocket_clean_domain', // exists.
                'hyper_cache_purged', // Stefano confirmed this will be added.
                'w3tc_flush_posts', // exits.
                'w3tc_flush_all', // exists.
                'ce_action_cache_cleared', // Sven confirmed this will be added.
                'comet_cache_wipe_cache', // still to be confirmed by Raam.
                'wp_cache_cleared', // cfr. https://github.com/Automattic/wp-super-cache/pull/537.
                'wpfc_delete_cache', // Emre confirmed this will be added this.
                'swift_performance_after_clear_all_cache', // swift perf. yeah!
            );
            $page_cache_purge_actions = apply_filters( 'autoptimize_filter_main_pagecachepurgeactions', $page_cache_purge_actions );
            foreach ( $page_cache_purge_actions as $purge_action ) {
                add_action( $purge_action, 'autoptimizeCache::clearall_actionless' );
            }

Are there any other implications of disabling by us w3 hooks by autoptimize_filter_main_pagecachepurgeactions filter?

@futtta

This comment has been minimized.

Copy link
Owner

commented May 21, 2019

Use this code snippet instead to disables the "listening to page cache purges";

add_filter('autoptimize_filter_main_hookpagecachepurge','__return_false');
@fliespl

This comment has been minimized.

Copy link
Author

commented May 21, 2019

Thanks much!

@futtta

This comment has been minimized.

Copy link
Owner

commented May 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.