Allow unique release version as part of key scheme #51
Loading…
Reference in a new issue
No description provided.
Delete branch "khromov/add-release-var"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Flushing the entire cache in APC or Memcached is not ideal because multiple sites can reside on same server, and because it can also cause the Object Cache to be cleared if you use the same backend for both.
This pull request allows for the use of the variable
$release
in the "Key scheme" to allow invalidation of WP-FFPC page cache when a new version is deployed.Use case: We want the page cache to be invalidated when a new version of the site is released without having to flush the entire cache backend.
With this PR, we can add the following to
wp-config.php
:(In this example,
16bb26116228a6c6090214b091725070d894e5ed
is the currently deployed Git hash)Then we will set
$release
as part of the key scheme:The raw cache keys will now be:
If we define
WP_RELEASE
dynamically for each release ( using a deploy system like Deployer or Capistrano) we can gracefully invalidate old cache entries without having to flush the entire cache.Bump!
@petermolnar Could you please take a look at this? I'm open to any feedback you have and would love to see this merged!
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.