• Resolved rolfhuiber

    (@rolfhuiber)


    We have a website with almost no updates. Some of the pages are expensive to create (>10seconds).

    We have page caching and object caching enabled (memcached), browser caching disabled (we serve the same pages, but user gets a different view when logged-in, solved by group cache using a cookie after login).

    We regularly see that pages are re-created and not taken from the cache. There is no W3TC cron job running.

    What are the reasons/times that pages get evicted and recreated?
    Does object caching evictions influence page caching?
    Where can the behavior be changed, so that only on a manual cache purge the pages get evicted?

    I have read the github wiki, but couldn’t find any information. Can you please point me to a more in-depth explanation of w3tc.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rolfhuiber

    Thank you for reaching out and I am happy to assist you with this.
    I just need to make sure I understand the question. When you say evicted, do you mean that the cache is purged?
    Where do you see that the pages are re-created and not served from the cache?
    If you are a Pro user, you can check the Purge log, and see what may be calling cache purge, as some plugins may call flush_all();
    It would be great if you could share the website URL.
    Thanks!

    Thread Starter rolfhuiber

    (@rolfhuiber)

    We are on a non-public staging server using the free version.

    The pages get purged (recreated) exactly one hour after creation.
    We observed several pages with a distance of 10 minutes firstly called. Until one hour they came from the cache. After exactly one hour they were recreated. The pages are recreated independent of each other.

    During the test the cron was disabled, no admin dashboard running and the test showed that the behavior is also seen for static pages.

    Which algorithm/configuration is in place to recreate the cache entry for a page after exactly one hour?

    What are the reasons/times that pages get evicted and recreated?
    Does object caching evictions influence page caching?
    Where can the behavior be changed, so that only on a manual cache purge the pages get evicted?
    
    I have read the github wiki, but couldn’t find any information. Can you please point me to a more in-depth explanation of w3tc.
    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rolfhuiber

    Thank you for yoru feedback.
    Are you seeing this in the expires header or are you checking the cache folder?
    W3TC does not purge cache on schedule. The cache is updated depending on a Purge Policy setting in Performance>Page Cache.
    SO there is no algorithm or configuration to recreate the cache entry after an hour. The page is cached once visited. When the cache is purged, pages are cached again on a visit.
    Now I am not sure which tests you are referring to, so it would be great if you could share more information and check if any other plugin or theme may be calling purge.
    Thanks!

    Thread Starter rolfhuiber

    (@rolfhuiber)

    >Are you seeing this in the expires header or are you checking the cache folder?
    The creation time is some 5-7 seconds, from cache the page is retrieved within 100msec.

    Browser cache has never been enabled. The responses contain:
    Cache-Control: max-age=0
    This behavior is also wanted by us, we want to fully control the caching on the server.

    We disabled object cache and set fragment cache to “Please select a method” (it is unclear if this disables caching, please make it more clear in the settings).

    The page cache purge policy settings at first were left at default, but also after unsetting all checkboxes:

    The pages are still recreated exactly after one hour after their first visit.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rolfhuiber

    Thank you for the information.
    Once again, can you please share where you are seeing this – How did you determine that the cached pages are recreated one hour after their first visit?
    What are the BC rules you are using for HTML&XML?
    Have you checked the Purge Log and is if and what may be calling purging to the cache?
    Thanks!

    Thread Starter rolfhuiber

    (@rolfhuiber)

    >SO there is no algorithm or configuration to recreate the cache entry after an hour. The page is cached once visited. When the cache is purged, pages are cached again on a visit.

    Well there is a configuration!

    pgcache.lifetime: Maximum lifetime of cache objects, defaults to 3600
    as used in Cache_Memcached::set( $key, $var, $expire = 0, $group = ” )

    The use of the term “cache objects” in the settings is confusing, as it correlates more to object cache settings, and not that it is a page caching setting.

    The term “cache item” is more general and is also the term used by memcached.

    I haven’t spent any further time into going deeper into the code. There are gc variables for dbcache, object-cache and page-cache. The question arises if pgcache.lifetime for all three cache types.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rolfhuiber

    Thank you for yoru feedback.
    This is not a configuration, but a behavior.
    Thank you for your input and suggestion, We’ll try to make things more clear in the future.
    Thanks!

    Thread Starter rolfhuiber

    (@rolfhuiber)

    >This is not a configuration, but a behavior.

    Not quite. A behavior is a set of actions. Here it is the semantics of a programming method. e.g.

    public Memcached::set(string $key, mixed $value, int $expiration = ?): bool

    Memcached::set() stores the value on a memcache server under the specified key.

    The expiration parameter can be used to control when the value is considered expired.

    The expiration parameter is a configurable option.

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @rolfhuiber

    Thank you for yoru feedback.
    I am sorry but I did not understand the question and missed the info regarding the Cacing method you are using.
    Yes, the Maximum lifetime of cache objects is keeping the cached files for the set time period.
    After that, the cache is expired and this is how the memory-based caching works as it’s not as persistent as Disk: Enhanced Caching.
    Thanks!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Page Cache Evictions’ is closed to new replies.