Introduce cache flush rules [RHELDST-26144] #734
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change extends the cache flush config to support separate rules with different templates, enabled via patterns matched against candidate paths for flush.
The goal here is to reduce the amount of unnecessarily flushed URLs/ARLs. In typical scenarios, we have three different CDN hosts in front of a single exodus-gw environment, with certain subtrees being only available from certain hosts. With the flat config structure existing before this change, we had no choice but to flush cache keys for all three of them for every path, even though each path is only relevant to one of the hosts. Hence, we were flushing 3x as many ARLs as we should be.
With this change we can update the configuration to only flush cache for the necessary CDN host for each subtree, significantly cutting down the number of cache keys for flush.
This commit is backwards-compatible with the old config style, so it can be safely deployed before updating exodus-gw.ini.