wp-supercache clear on update

HomeForumsRequestswp-supercache clear on update

This topic has 1 voice, contains 5 replies, and was last updated by  Marcel 118 days ago.

Viewing 6 posts - 1 through 6 (of 6 total)
Author Posts
Author Posts
19 January 2012 at 13:29 #5074

tom

hi,

all other threads related to cache-plugins are clode, so i need a new one:

im running wp-supercache and everythings seems to work fine. gallery overview, gallery pages and slideviews are all cached.

my only problem: cache-files are not refreshed on update. the old version is online until a comment is written or i delete the coresponding cache-file manually. is there a way to do this on update? for comments it seems to work somehow!?

19 January 2012 at 14:05 #5076

Marcel

When a comment is writen wp-supercache automatically renews the cache.
I’ll dig into wp-supercache to find how you could renew the cache on a page update.
BTW, do you use LG permalinks and mod_rewrite to serve the cached pages?

19 January 2012 at 14:58 #5077

tom

hi marcel,
yes i’m using lg permalinks and mod_rewrite.
tom

20 January 2012 at 9:29 #5082

Marcel

The only hook available in LG 1.1 is the 'lazyest_image_found' filter, fired when a new image has been found in a folder.
I will add more hooks in version 1.2
The script below could rebuild the cache for the gallery like when a comment has been made.

function my_gallery_cache( $image ) {
global $lg_gallery;
$post_id = $lg_gallery->get_option( 'gallery_id' );
wp_cache_post_change( $post_id );
return $image;
}
add_filter( 'lazyest_image_found', 'my_gallery_cache' );

I will add more hooks in version 1.2

20 January 2012 at 14:41 #5087

tom

thank you marcel for this info. but on new comments the cache allready is refreshed.

i need some function to rebuild the cache when title, description or an extra field was changed by editor. so at this point when the captions.xml is updated.

btw: i did not realize before, the cache for the whole gallery is re-written when there is a new comment for the post-id of [lg_gallery]

so it almost makes no sense to cache the gallery when all cachefiles are rewritten x times a day when there is one more comment on my 1x.xxx fotos… :-(

20 January 2012 at 17:14 #5089

Marcel

It still makes sense to cache the gallery because not every visitor is going to comment, do they?
The code above will reset the cache when a new image has been uploaded.
I’ll dig into wp-supercache to see how we can prevent resetting the cache for the whole gallery.

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘wp-supercache clear on update’ is closed to new replies.

RSS RSS feed for this Topic