• Resolved John Huebner

    (@hube2)


    As the title says, is there any way to add a string to regected urls from a plugin?

    I am building a plugin and I need specific urls to not be cached to served from the cache if a specific url query string is present. I would like to be able to do this without the need to have someone using the plugin add this string on this plugin’s advanced setting page.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hi there, @hube2,

    I am not sure whether there’s a way to filter the settings in WP Super Cache. Onbe of our developer is going to take a look later on this, and will reply below. Thanks for bearing with us on!

    Plugin Author Donncha O Caoimh (a11n)

    (@donncha)

    Hi @hube2,

    Usually, the best way of stopping a page being cached is by disabling caching using the “DONOTCACHEPAGE” constant. Your plugin will hook onto “init” and in that function, check what page is being shown to the user. It can define that constant and that will disable caching during that request. While the output buffer will have been created by the plugin, it won’t save it to a file.

    Something as simple as define( 'DONOTCACHEPAGE', 1 ); will do that job.

    If you need to delete the cache for a particular URL first, you can use the wpsc_delete_url_cache( $url ) function. If it’s cached, the init hook won’t run on that request. (unless late_init is enabled, but that’s to be avoided)

    Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hi there @hube2,

    Do you have updates about that, do you still need help? We usually close inactive threads after one week of no movement, but we want to make sure we’re all set before marking it as solved. Thanks!

    Thread Starter John Huebner

    (@hube2)

    I’m good for now, other things came up and this is on a back burner.

    Plugin Support Stef (a11n)

    (@erania-pinnera)

    That’s fine @hube2!

    If you have any further questions or need more help, you’re welcome to open another thread here. Cheers!

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