Closed aerni closed 2 months ago
This PR might yet need another refactor as per recent discussions in https://github.com/statamic/cms/pull/10306.
Any chance to get this merged soon? There's already been a couple of people on Discord asking why static caching doesn't work anymore with the latest release.
@aerni you've set it as draft. Is it ready?
Oh yeah, sorry. Totally missed that. This PR is ready to go.
Thanks for your work @aerni
This PR makes the
AssetsReplacer
work with full measure static caching and closes #63.Previously, we injected the Livewire assets in the
replaceInCachedResponse()
method. However, this method is never hit when using full measure static caching. I didn't initially catch this issue locally, as mentioned in #63.All assets are now injected in the cached response to make it work with both half and full measure static caching. I basically copied Livewire's assets injection to make this work.
The
419 Page Expired
issue mentioned in #63 was due to the CSRF token not being injected at the time of making a request tothis.$wire
. This is a separate issue that requires a PR to Statamic'sNoCacheReplacer
. See https://github.com/statamic/cms/pull/10306.