Activation of plugin that registers a new tag visitor should automatically make URL Metrics stale #1424
Labels
Needs Dev
Anything that requires development (e.g. a pull request)
[Plugin] Optimization Detective
Issues for the Optimization Detective plugin
[Type] Enhancement
A suggestion for improvement of an existing feature
Milestone
When activating a plugin that registers a new tag visitor for Optimization Detective, this should automatically result in all existing URL Metrics to be considered stale. This is so that new URL Metrics can be gathered which take into account the new tag visitor(s). Additionally, each tag visitor should perhaps taken an optional version identifier which can also be used to invalidate cached URL Metrics when the version is bumped. When a URL Metric is stored, there should be a new field that contains the "ETag" of sorts. This ETag would consist of a list of all of the tag visitors' IDs and their versions. For example:
At runtime if the generated string for the current environment does not match this field in the URL Metric, then it would be the same as if the URL Metric's timestamp is old enough that it is considered stale here:
performance/plugins/optimization-detective/class-od-url-metrics-group.php
Lines 230 to 235 in 08eba80
Related to this is #1419 which proposes that tag visitors be allowed to declare other tag visitors as dependencies. In this way,
OD_Tag_Visitor_Registery
is increasingly starting to look likeWP_Scripts
orWP_Script_Modules
.The text was updated successfully, but these errors were encountered: