- Issue created by @maro22
- 🇮🇳India Shreya_98
To clear the Varnish cache when you update node content in Drupal, you need to send a cache-clearing request to Varnish when a node is updated. This can be achieved by using a combination of Drupal modules and Varnish configuration.
-> Install and enable the following Drupal modules if they are not already:
Purge: The Purge module provides a unified interface for clearing various types of caches, including Varnish.The Purge module integrates with Drupal's cache tags system and can be used to send cache-clearing requests to Varnish when content is updated. Here's how to set it up:
Go to Admin > Extend and enable the "Purge" module.
Go to Admin > Configuration > Development > Performance > Purge settings.
Configure the "Purge strategy" based on your needs.
Under the "Purge processors" section, make sure "Purge Tags" is enabled. This will send cache clearing requests based on cache tags.
Save your configuration.After configuring the Purge module and ensuring your Varnish server is properly set up to handle cache invalidation, test the cache clearing behavior by updating node content and observing whether Varnish clears the cache accordingly.
- 🇮🇳India Shreya_98
You generally don't need to manually add or manage the X-Drupal-Cache-Tags header; by default Drupal core handles it .
So, use Purge-Cache-Tags.
- 🇬🇧United Kingdom steven jones
So sorry to dump this into the Varnish Purge issue queue, but this looks like a support request for that project, not the Varnish module, so I'm moving it over. Feel free to close it out etc.
@maro22 I hope you got your issue sorted!