You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We cannot purge CDN content by cache tag (varnish based CDN e.g. Fastly) when FullPageCache is enabled, unless we flush the entire FullPageCache on purge. And disabling the FullPageCache then forces an un-cacheable Cache-Control header.
We want FullPageCache enabled and handling the Cache-Control header, because this keeps all cache responsibility in the same location.
It would be a huge improvement to allow the manipulation of the FullPageCache tags, because we can then append the response Surrogate-Key/Cache-Tag header tags to the tags used for Cache::save.
Move the dispatch of the PrepareResponseEvent event after the $tags, and pass the $tags to the event for manipulation.
Dispatch a new event to manipulate the Cache parameters (if you want to keep the responsibility of the PrepareResponseEvent to only handle preparing the response for cache.
In my opinion, option 1 makes the most sense and also a good improvement on the FullPageCache.
The text was updated successfully, but these errors were encountered:
Would you also need to remove the default tags outputand output_lifetime. Because I'm not too sure if we should allow manipulating these too as they are crucial for internal Pimcore cache handling and fiddling around with them might have unwanted side effects.
When it is just about adding additional events it might be enough to allow to add additional tags via the prepare response event, wdyt?
@fashxp for varnish tags we don't need to manipulate existing/system tags. We just need to add additional tags.
You can use the prepare response event (as it currently is) to pass the additional tags to the Cache:save $tags. But depending on the setup, the tags header can be X-Cache-Tags, Surrogate-Key or Cache-Tag. And you would need to also consider that sometimes there will be multiple cache tags to allow more tags than the 4kb limit. So it's not so easy to get the tags header value to set the $tags.
The best solution would be to allow the prepare response event to set some tags, and then set the $tags = array_merge($event->getTags(), $tags) to merge them with the Pimcore system tags.
Thanks a lot for reporting the issue. We did not consider the issue as "Pimcore:Priority", "Pimcore:ToDo" or "Pimcore:Backlog", so we're not going to work on that anytime soon. Please create a pull request to fix the issue if this is a bug report. We'll then review it as quickly as possible. If you're interested in contributing a feature, please contact us first here before creating a pull request. We'll then decide whether we'd accept it or not. Thanks for your understanding.
Improvement description
We cannot purge CDN content by cache tag (varnish based CDN e.g. Fastly) when FullPageCache is enabled, unless we flush the entire FullPageCache on purge. And disabling the FullPageCache then forces an un-cacheable Cache-Control header.
We want FullPageCache enabled and handling the Cache-Control header, because this keeps all cache responsibility in the same location.
It would be a huge improvement to allow the manipulation of the FullPageCache tags, because we can then append the response
Surrogate-Key
/Cache-Tag
header tags to the tags used for Cache::save.https://github.com/pimcore/pimcore/blob/11.x/bundles/CoreBundle/src/EventListener/Frontend/FullPageCacheListener.php#L338-L346)
There are 2 possible solutions:
In my opinion, option 1 makes the most sense and also a good improvement on the FullPageCache.
The text was updated successfully, but these errors were encountered: