Skip to content

Commit 64f3144

Browse files
Merge pull request #389 from JLG-WOCFR-DEV/codex/update-tokenregistry-to-invalidate-css-cache
Ensure CSS cache invalidates when TokenRegistry regenerates styles
2 parents f022e67 + b54198f commit 64f3144

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

supersede-css-jlg-enhanced/src/Support/TokenRegistry.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ public static function getRegistry(): array
380380

381381
if ($needsCssRegeneration) {
382382
self::persistCss($normalized, $generatedCss);
383+
self::invalidateCssCache();
383384
}
384385
} finally {
385386
self::endOptionPersistence();
@@ -399,6 +400,7 @@ public static function getRegistry(): array
399400
try {
400401
update_option(self::OPTION_REGISTRY, $fromCss, false);
401402
self::persistCss($fromCss);
403+
self::invalidateCssCache();
402404
} finally {
403405
self::endOptionPersistence();
404406
}
@@ -414,6 +416,7 @@ public static function getRegistry(): array
414416
try {
415417
update_option(self::OPTION_REGISTRY, $defaults, false);
416418
self::persistCss($defaults);
419+
self::invalidateCssCache();
417420
} finally {
418421
self::endOptionPersistence();
419422
}
@@ -1317,7 +1320,6 @@ private static function persistCss(array $tokens, ?string $precomputedCss = null
13171320
}
13181321

13191322
self::writeOption(self::OPTION_CSS, $css);
1320-
self::invalidateCssCache();
13211323

13221324
return true;
13231325
}

0 commit comments

Comments
 (0)