Exclude WPP from WP Super Cache
-
Hi,
I’m having a small issue where the WPP widget loads “forever” at certain times. I’m pretty sure this is due to the pages being cached via WP Super Cache. Is there any way to prevent the widget (not the entire page) from being cached?
I’ve searched about this before posting this question, but couldn’t find any working solution.
Many thanks and best regards, Samuel
The page I need help with: [log in to see the link]
-
Hi @swissprice,
That sounds like your page cache expiry time might be a bit too high? I generally recommend getting caching plugins to renew their page cache every 12 hours (or at most every 24 hours but not more than that) or else the plugin may fail to load once the cached post/page is older than 24 hours (see Is WordPress Popular Posts compatible with caching plugins? for more details.)
If your page cache is already set to expire every 24 hours or less then the problem may be coming from somewhere else, and in that case I’d love to see the full list of active plugins to see if anything in there stands out (see Settings > WordPress Popular Posts > Debug).
Marking topic as resolved due to inactivity.
OP, if there’s anything else I could help with please feel free to leave a comment below.
Hello Hector,
Thank you for the reply and sorry for the delayed repsonse.
Currently I have not set any cache expiry. I use the preload feature and preload everything manually once I’m done working on my website after adding new content. Do you think there is any workaround? The WPP is the only non-static content on my website.
Best regards,
Samuel
Hi @swissprice,
TLDR;
No, there is no good workaround. Read below to learn why.
—
Your original problem is that your popular posts list gets stuck at the loading animation. WordPress Popular Posts uses nonces to secure AJAX calls to your site’s REST API, including the one it makes to pull your popular posts list dynamically into the page. These nonces -as explained on the FAQ I linked to on my previous response- expire after ~24 hours by default, hence the requirement to have your cache also expire every 24 hours or less.
What you may have not realized yet is that WPP also uses these nonces to secure views count update requests via REST API.
So let’s say that you’re OK with having your popular posts list being fully static (Settings > WordPress Popular Posts > Tools > Data > Load popular posts via AJAX > Disabled > Apply, then clear your site’s cache). You still need your site’s page cache to expire every 24 hours at least (unless you change the default TTL value for nonces which can be detrimental to your site’s security, also explained in the FAQ) or else WPP will have trouble tracking visits to your posts & pages.
So, please make sure that your site’s page cache expires every 24 hours or less so WPP can work as expected on your site.
Hello Hector,
Thank you for the explanation.
I have therefore modified the settings of my cache to expire every 24h.
Many thanks and best regards,
Samuel
The topic ‘Exclude WPP from WP Super Cache’ is closed to new replies.