Skip to content

Publish to Apple News causes unnecessary purge events #206

@jasonbahl

Description

@jasonbahl

When the "Publish to Apple News" plugin is active along with WPGraphQL Smart Cache, there's a LOT of unnecessary cache purges happening.

The cache invalidation strategy for WPGraphQL Smart Cache is to purge caches for nodes when that node, or meta of that node is updated, unless the meta has been specifically ignored, or starts with an underscore (the non-enforced, but common practice for making meta "private")

The "Publish to Apple News" plugin has code that updates user meta for the meta key "apple_news_notice" quite often, causing any query with that user to be purged. Since this meta key doesn't start with an underscore, it's tracked as an update to the user object, triggering a cache purge for that user node.

This means any query where that author was in the query response will be purged from the cache. Typically, this will mean any page/post written by that author will be purged when the apple news meta key is updated, which is happening quite often from what I can tell. This would lead to a lot of cache misses and an overwhelmed server on higher traffic sites.

Metadata

Metadata

Assignees

Labels

type: bugIssue that causes incorrect or unexpected behavior

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions