Skip to content

Allow filtering the TTL for matching ad codes#111

Merged
GaryJones merged 3 commits into
Automattic:developfrom
dlh01:ad-code-cache-filter
Mar 15, 2022
Merged

Allow filtering the TTL for matching ad codes#111
GaryJones merged 3 commits into
Automattic:developfrom
dlh01:ad-code-cache-filter

Conversation

@dlh01
Copy link
Copy Markdown
Contributor

@dlh01 dlh01 commented Oct 22, 2020

In the VIP Go environment, pages are typically cached in Varnish for 30 minutes, but Ad Code Manager currently caches matching ad codes for only 10 minutes, meaning the cache is likely to expire before it can be reused.

Because cache keys are derived from the current query vars, each ad code gets a new cache key for essentially every page, which starts to add up to a lot of infrequently reused cache keys on a high-traffic site with many ad codes.

This PR allows the cache TTL to be filtered to a value higher than 10 minutes, or, alternatively, to false, which causes the matching ad code to be cached only in memory.

@GaryJones GaryJones added the type: enhancement New feature or request label Mar 14, 2022
@GaryJones GaryJones added this to the 0.6 milestone Mar 14, 2022
@GaryJones GaryJones changed the base branch from master to develop March 14, 2022 17:02
Comment thread ad-code-manager.php Outdated
@GaryJones GaryJones merged commit 4bcec10 into Automattic:develop Mar 15, 2022
@GaryJones
Copy link
Copy Markdown
Collaborator

Thanks, @dlh01!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants