Make WordPress Core

Changes between Version 1 and Version 2 of Ticket #59592, comment 5


Ignore:
Timestamp:
10/11/2023 10:54:00 PM (3 years ago)
Author:
nickchomey
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #59592, comment 5

    v1 v2  
    1 This article describes what seems to be the opposite of what is proposed here, but is worth reviewing for inspiration.
    2 https://signalvnoise.com/posts/3113-how-key-based-cache-expiration-works
     1Perhaps I'm missing something fundamental, but it seems to me that (at least part of) the conversation here and in #57625 is focusing on the wrong thing - largely how the cache is configured. Specifically, focusing on cache key TTL rather than having an appropriate cache eviction policy for the cache data (e.g. LRU, which I believe is the default for Redis). https://redis.io/docs/reference/eviction/
    32
     3If you use something like allkeys-lru, then the only way actively-used keys could get evicted is if your cache is too small - a hosting error, not WP. If you do want to use TTL/expire on specific keys, then perhaps volatile-lru could be used. It seems to me that this decision should be up to the site owner, not WP Core.
     4
     5This all seems to roughly echo what Peter Wilson said in his initial comment: https://core.trac.wordpress.org/ticket/57625#comment:3
     6
     7Perhaps a solution the present problems is to give users and plugins more control over caching policies such as whether to apply a TTL or not to a specific cache key? Also, to provide documentation/guidance on proper server cache (redis) config - both for users who manage their own servers, as well as for hosting providers to do a better job at.
     8
     9This article from Ruby on Rails goes into detail about using key-based cache expiration, so it seems worth reviewing for inspiration.
     10https://signalvnoise.com/posts/3113-how-key-based-cache-expiration-works
     11I hope this is helpful rather than irrelevant/a distraction!