cache varnish when update node

Created on 10 August 2023, 11 months ago
Updated 27 April 2024, 2 months ago

Problem/Motivation

Hi,
How i can clear varnish cache (like cache drupal) when i update node content ?!

💬 Support request
Status

Active

Version

1.0

Component

Code

Created by

🇫🇷France maro22

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

Comments & Activities

  • 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.

  • 🇫🇷France maro22

    hi,
    i use Purge-Cache-Tags or X-Drupal-Cache-Tags ?

  • 🇮🇳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!

Production build 0.69.0 2024