Purger does not purge pages not found cache

Created on 14 April 2021, almost 4 years ago
Updated 5 March 2025, about 1 month ago

There is a problem with this module happens for pages not found.

Steps to reproduce:
1. As an anonymous user visit page /non-existing-page
2. You can see 404 error, but this page got cached by Varnish
3. As an admin using a different browser add a new node with the URL alias /non-existing-page
4. Visit /non-existing-page as an anonymous user
5. You can still see 404 error

The problem happens because not found page does not have the unique cache tag, so there is no way to flush cache for it using cache tags. 404 page has only basic Drupal tags and there is no way to assign the unique cache tag for it, because such page does not exist. We don't know whether it would be a node-1 or node-2 in advance.

I am not sure if using URL Queuer would be a good idea here since it will queue tons of URLs. At least on the new page (node, entity, view, etc...) creation we need to flush Path/URL for such page. Is there a way to do it? Is there a workaround?

πŸ› Bug report
Status

Active

Version

3.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States dealancer Washington D.C.

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ͺπŸ‡ΈSpain lpeidro Madrid

    Hello,

    We are experiencing this issue on a client project, but the solution proposed by maximpodorov is not working properly in our case and does not resolve the issue.

    We have created a simple module that might be useful to help solve this problem Url Purge Aggregator β†’ .

    It is a very simple queuer that adds the URLs to the Purge queue when a node is edited or removed. This functionality can be enabled through configuration.

    In this case, it would be necessary to implement the hook_entity_insert() hook to use the service provided by the module (url_purge_aggregator.queuer) to add the node's URL when it is created.

    I am going to create an issue to add this option as well.

    I hope this module can be useful.

Production build 0.71.5 2024