Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I wonder if there is possibility to generate WP-Super-Cache programmatically after the cache is being purged ( after I have published a new post ). I thought of writing some kind of crawler that will go trough all of my pages and generate new cache that way. But I wonder if there is another possibility?

P.S. I set up a setting that my cache is being purged after I published a new post, but what I need is that not all of my cache to be deleted, after I publish a new post, but only one for archives and categories ( because those are dynamic pages ) , so if there is an opportunity to somehow select what cache will be purged, there is no need to regenerate all of the cache, as I asked in the question. Hope I made it clear. Thanks.

share|improve this question
    
WP-Super-Cache should be purging related caches when a post is published or changed. Is this not working right? –  SickHippie Jun 28 '12 at 21:08
    
It is purging all cache ( there is such an option in plugin's settings ). –  Godforever Jun 28 '12 at 21:09
    
So turn off the option to purge all cache. The plugin handles the rest of it. It will rebuild the related pages when first served up. In other words, this plugin already does what you want it to do - that's kinda the point of this type of plugin. –  SickHippie Jun 28 '12 at 21:15
    
Alright, I did what you said, and basically I got what I wanted. But I faced one problem. In the right corner of my page I have a counter which show how many posts I have for last week, for today and at all. This counter is basically on each page. As the page is being cached, this counter shows the wrong number. How do I deal with that? –  Godforever Jun 29 '12 at 10:25
    
From the WP Super Cache FAQ - "Other dynamic elements on a page may not update unless they are written in Javascript, Flash, Java or another client side browser language." In other words, if you have a php-driven counter on each page, you will need to flush the entire cache each time you post, or find a different counter that uses JavaScript to insert the number of posts. Alternately, you may have better luck with a different, more robust caching plugin - like W3 Total Cache, perhaps. It's harder to set up, but has more options for things like this. –  SickHippie Jun 29 '12 at 16:05
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.