Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 305 Vote(s) - 3.58 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Varnish cache - How to purge/delete cache only for Home page

#1
I'm using Drupal 7 latest dev version.

I have installed Varnish and Expire modules and setup them. They are working very well but I have one problem regarding deleting cache from varnish.

The problem is how to **delete** varnish cache only for **index(home)** page and not to delete cache for other pages. I look at he varnish log and I found that whole varnish cache is deleted every time Drupal executes command

ban req.http.host ~

[To see links please register here]

&& req.url ~ "/"

This command is executed by varnish module or expire module and it means delete cache of home(index) page. But as I see it is deleting all cached pages in varnish.


**How to fix this? How can I delete only cache for home page?**
Reply

#2
You should invoke other command from Drupal:

ban req.http.host ~

[To see links please register here]

&& req.url ~ "^/$"
Cache invalidated for whole site, because regexp "/" matches all URLs
Reply

#3
You could also do

ban req.http.host ==

[To see links please register here]

&& ban req.url == "/"

Reply

#4
Will this Drupal Purge module do it for you?

[To see links please register here]

Reply

#5
There is the [Varnish HTTP Accelerator Integration][1] module, which provides a very useful function varnish_purge().

Use the function to clear the varnish cache.


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through