How long APO keep cached posts?

How long does Cloudflare APO keep the cached version of the post on CF-servers?

I mean: i edit or update post. I make first visit with incognito mode and got dynamic content. (Now cached version created!) Next user receive fresh cached version (HIT) of post.

If after that I will not edit post for a long time, then how long will the CF APO keep the cached version of the record on CF-servers?

If no visitor requested the content, APO will keep the content up to 30 days. As long as the post receives traffic within 30 days the content will keep being cached.


When i purge URL via Cloudflare API purge_cache, CF-servers create fresh cached version of purged URL, or fresh version of page will be created after first anonymous visit, and first visitor got dynamic URL?

If that, how i can purge URL and create fresh cached version? With wp_remote_get() executed after receive response from CF API purge_cache? Wich headers i must sent with wp_remote_get() to create fresh cached version of URL after purging?

Now i use custom function, which purge edited post’s URL and relative URLs with CF API and then crawling purged URLs with wp_remote_get() for create fresh version of cache of post and relative URLs. But first visit after this return dynamic headers for cf-cache-status and second visit return HIT-version of post.

Actually, there are two reasons why I ask these questions. I have an online store. I want users to get fresh data after updating the price or product availability, but with the cf-cache-status: HIT in the headers.

A few days before there was another problem: I updated the price or stock, and the first user got the previous version of the cache, and only the second user got the newly created cache. Now, after updating the record, the first user receives the updated price, but DYNAMIC is visible in the headers. And I want to kill two birds with one stone: give to first user updated data, but HIT-data :slight_smile:

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.