Here's my issue for dealing with other content types
http://drupal.org/node/453908
I've hit a brick wall when it comes to views and panels. Also we should try to keep similar data structures & info grabbing functions. We might want to make a module that does this, once the Varnish module is up and running; so both projects can depend & benefit from it.

Comments

mikeytown2’s picture

ping... I think I figured out how to expire views based on a node changing. Node creation and views... still looking for a sane solution. Could run every view and make a note of nid's that match the newly created one... maybe I do that on cron, instead of on node creation via boost_has_site_changed() function. Panels have to be added manually so this would not be an issue ATM.

mikeytown2’s picture

Version: » 6.x-1.x-dev
mikeytown2’s picture

Title: Boost & Varnish Collaboration » Cache Expiration & Varnish Collaboration

hook_expire_cache() is the hook, returns array of all the urls to expire. I also need a hook for a cache flush as well.

vacilando’s picture

Subscribing.

bibo’s picture

@ mikeytown2

ping... I think I figured out how to expire views based on a node changing. Node creation and views... still looking for a sane solution

It seems you've found views_content_cache and cache_actions after that comment :) I also happen to be using both of them, and have been actually wondering how hard it would be to implement varnish purge support that works with views_content_cache? That is: when node of type x and y are added/updated, views_content_cache clears the views AND varnish-module recognizes this and purges the cache for the view/panel url. Would it be possible?

Expire-module sounds usefull, but judging from the description..

Playground for ripping the boost expiration code out so other modules can use it.
There is now experimental integration with the Varnish module...

.. expire only works with boost, right? Can it be used for anything if I dont have boost? Boost + Varnish somehow seems like duplicating the same effort without actual gain. Please tell me why this assumption is wrong :).

What if I want to flush some page caches more often than others, such as the frontpage? Do I have to create a custom module, or does expire provide options for that?

mikeytown2’s picture

Expire is a stand alone; does not use boost in any way, other then some of the code looks very similar ;)

Neither one of my projects (boost or expire) deals with views or panels internal cache. This is something to look into further down the road.

In terms of views/panels, in Boost we record what nodes show up when the view or panel is rendered. Then when that node changes, Boost knows where that node lives and mark those pages as expired. This requires a database in order to keep track of node deletions; thus it is still only in the boost module. I'm currently thinking up some ideas on how to make the code faster. Boost records this info on page views (it's already rendered and we get the URL as well) but this causes too many writes to the database. So the next step is to make the update logic for the database smarter (its very dumb right now). Step after that is to get Boost argument, pager and url query string aware. Once that is in place then some truly awesome cache expiration code can be written. Read this for more info: http://groups.drupal.org/node/100134#comment-319014

BTW you can use boost and varnish at the same time; at work we use boost for its expiration logic and as a backup in case servers die on us and we need a static cache to be served while varnish gets populated with Drupal again

bibo’s picture

Thanks mikeytown2 for your interesting and detailed answer :). The leading text on the expire project page still seems a bit misleading to me, since I can only read it as "this module requires boost".

I will be soonish in a project where we will be using varnish extensively (with ESI), and now I know we can use the expire-module whether we use (the awesomeness of) boost or not. Good point about the backup system, we probably will be using both.

YK85’s picture

Hello,

I was wondering if there may have been further development with expiring of cache for specific nodes after updates etc?

Thank you!

fabsor’s picture

If you use the expire module together with this module, it will expire nodes in varnish after you update them, so that should already be working. It also works for creation and deletion of nodes.

misc’s picture

Issue summary: View changes
Status: Active » Fixed

As a part of a clean up of the issue queue for the varnish module I am closing tickets that had no activity for the last year, please feel free to re-open if needed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.