I am using the Varnish module with Varnish 4, and I'm trying to set up the Cache Expiration so that inserted/updated nodes of a certain content type will expire the updated node and the home page. I have the status set to External with node actions of insert & update selected and urls of front page & node page to be expired.
After I update a node, I see this in my watchdog logs --
Expiration was executed for the next URLs:
URL:
Wildcard: false
Expired object: node
--------
URL: node
Wildcard: false
Expired object: node
--------
URL: node/240415
Wildcard: false
Expired object: node
--------
Neither the node or the home page are actually updated when I refresh the page. If I manually flush the page cache, then the updates are reflected (which is why I think Varnish is working okay.)
Any suggestions?
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 2508970-4-clear-internal-cache-too.patch | 468 bytes | rupertj |
Comments
Comment #1
spleshkaDo you use external expiration or internal (module settings) ?
Comment #2
skoehn180 commentedI have external expiration selected
Comment #3
WebWalker3D commentedIs there any update on this? I'm also experiencing this issue, both with dev and regular release.
Comment #4
lolcode commentedI have the same issue also using varnish and with external expiration selected.
Going by the request headers it looks very much like the varnish cache is getting cleared (now that I have applied the patch here: https://www.drupal.org/node/2558729) but that the internal cache is not being cleared so that varnish gets the same page again. After the expire is triggered and recorded in watchdog I can re-request the page as an anonymous client and get th
In fact I was able to work around the issue by making a change in expire.api.inc lines 109-114:
Comment #5
joinso commentedHi!
I have the same problem.
I'm using 7.x-2.0-rc4+5-dev, with External Expiration (MemCache API).
Any idea?
Regards,
JOINSO
Comment #6
joinso commentedI changed to MemCache Storage, and It doesn't work.
Regards,
JOINSO
Comment #7
rupertj commentedHere's a patch that implements lolcode's fix from #4.
I think the UI could be improved a bit as well as this, to make it clearer what's going on, but given how clearing an external reverse proxy cache doesn't actually seem to work at the moment, getting this part fixed first would seem to be important.
Comment #8
joinso commentedI made some test with MemCache, and I see that doesn't work as expected.
It says that the urls was expired but not.
This urls belongs to Panels Page Variants.
Expire invalidates Panels Page Variants caches also?
Regards,
JOINSO
Comment #9
rupertj commentedJOINSO - have you tried the patch I posted (or lolcode's suggested edit - they're the same thing)? This fixes the issue for me.
Comment #10
joinso commentedYes, I tried.
It doesn't work.
:(
The problem is that I have a Panel Page with Variant Displays, and it seems the cache_panels is not expired.
Regards,
JOINSO
Comment #11
johnennew commentedSurly an external cache clear also needs the internal cache clearing as well?! I feel like I'm missing some understanding or setup somewhere!
Patch in #7 does the job and makes the expire module work how I would expect.
Thanks
Comment #12
mfbI'd echo that this patch makes sense.
I've had to create custom site-specific modules to take care of purging the internal page cache when using say Rules module to purge caches, which is easy enough but seems silly :)
Comment #13
michel.settembrino commentedMe too I can say that patch in #7 does the job and makes the expire module work how I would expect.
Comment #14
sgdev commentedMay also want to examine a patch I just posted regarding a core bug that was fixed in D8 and never backported to D7:
https://www.drupal.org/project/expire/issues/2412517#comment-13170084
resetCacheis being executed after the Expire module hooks, not before it.Comment #15
sgdev commentedAlso regarding the patch in #7, it looks like it is just re-running the expiration code twice to achieve the intended result. I don't think this is the right approach, it just masks the underlying issue. Please review the patch I referenced in #14. Thank you.
Comment #16
sgdev commentedI just examined this more closely and I think I understand why a patch like this needs to exist.
We're using both Varnish and Redis, Our Varnish logs look fine when purging pages. However, Redis is storing to
cache_entity_*bins using the Entity Cache module. I think I need to write a patch to provide support for this.