• Resolved asimjaved133

    (@asimjaved133)


    I have custom theme and using “wp super cache” and want to omtimized it for my theme so less server could be used and visitors should have updated pages. i just need to know some functions

    1. Function to delete/update specific cache by Post ID
    2. Delete/update cache only for homepage.
    • This topic was modified 4 months, 1 week ago by asimjaved133.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter asimjaved133

    (@asimjaved133)

    i did some and found two functions

    1. wpsc_delete_post_cache
    2. wpsc_delete_url_cache

    is it good to use them to delete indiviual caches?

    Hi,

    wpsc_delete_post_cache can be used to delete the cache for a single post, but wpsc_delete_url_cache may not work if get_option( 'home' ) has a trailing slash and your website is at “/”.

    What you could do instead is:

    $supercachedir = get_supercache_dir();
    wpsc_rebuild_files( $supercachedir );
    prune_super_cache( $supercachedir . '/page', true );

    The last line will delete the “page” archives for the homepage.

    Thread Starter asimjaved133

    (@asimjaved133)

    Thanks a lot.

    Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hey @asimjaved133,

    I am grad we could help ?? I’m going to mark this thread as solved. If you have any further questions or need more help, you’re welcome to open another thread here. Cheers!

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.