Does this plugin recognize DONOTCACHEPAGE flag?
-
I went through the code, however the plugin doesnt seem to recognize DONOTCACHEPAGE flag which all major WP caching plugins recognize.
Is there a way to tell WP Fastest Cache via PHP to not cache a page? Like setting a flag if a certain page which we dont want cached is being loaded?
-
Please take a look at the following tutorial.
https://www.wpfastestcache.com/features/exclude-page/#exclude-page-manuallyUnfortunately, manual exclusion of a page would not work in our case. We want to automatically (programmatically) exclude certain pages which our users gate/lock to be only for members. So when a user gates a post to be only for members, we need to have a way to tell WP Fastest Cache that it shouldnt cache that page during page load.
Something like DONOTCACHEPAGE to prevent the page from being cached, or better, something like WPSC_SERVE_DISABLED flag of WP Super Cache that prevents serving a cached page and instead loads the live version.
thank you so much. I will add and let you know.
Much appreciated. Looking forward to it.
I have an idea. A function is called if a developer wants to exclude a page. I can detect which plugin excludes the page this way.
Might work, but how is that exactly going to work?
If that function is called during a page load, Fastest Cache will not serve the page from the cache or something?
Might work, but how is that exactly going to work?
A constant may be defined or the function may add something into the html source.
If that function is called during a page load, Fastest Cache will not serve the page from the cache or something?
Exactly.
Checking for a constant could definitely work. I believe WP Super Cache and W3 Total Cache are also doing it. Fastest Cache can check if that constant is defined, and then skip serving page from cache.
I added the feature for you. Please take a look at the following tutorial.
https://www.wpfastestcache.com/features/exclude-page/#hook
you need to delete wp fastest cache and download the following version to get the latest changes because I did not release the new version yet.
Note: You need to add the following line into the wp-config.php to detect that the page is excluded by which plugin or theme.
Is it ok if we define this in a plugin file instead of adding it to wp-config.php?
Because it is inconvenient to have thousands of users add this line to their wp config.
no, you do not need to define anything in wp-config.php.
it is just for debug. I removed this part from tutorial because it was confusing.Tested with the package you provided above:
When used from inside a function hooked to ‘wp’ hook, wpfc_exclude_current_page() does not trigger.
It turns out that if a page is cached, functions hooked to ‘wp’ action hook do not become available. Likely because WP Fastest Cache does its processing at a hook earlier than ‘wp’ hook?
What is the latest action hook which this function can be called during WP’s initialization?
Can you contact me via email please: https://www.wpfastestcache.com/contact-us/
Following this topic, because I’m also interested in such a functionality to use with my plugin https://wordpress.org/plugins/404page/
Please keep me informed
Please take a look at the following tutorial.
https://www.wpfastestcache.com/features/exclude-page/#hook
you need to delete wp fastest cache and download the following version to get the latest changes because I did not release the new version yet.
The topic ‘Does this plugin recognize DONOTCACHEPAGE flag?’ is closed to new replies.