0

Consider (the hypothetical ) case in which a page is cached which contains blogsposts which in turn contains comments. Now 1 comment changes. This means the cache for the blogpost has to be invalidated and (transitively) the cache for the page has to be invalidated.

In other words: items relate to eachother in a way that can be described as a Dependency Graph (which is a Directed Acyclic Graph )

Does Varnish support this type of Cache invalidation? If not, any other implementation, research, etc. that partially covers this?

Geert-Jan
  • 18,623
  • 16
  • 75
  • 137

1 Answers1

1

There's no support for exactly what you are asking for but as a workaround you can put tags in your headers as to what comments they are dependent on. For example sending a:

x-depend-comments: 2578 2579 2580

And then at an update of a comment you can send a ban request as:

ban obj.http.x-depend-comments ~ ā€œ\D2578\Dā€
Clarence
  • 2,944
  • 18
  • 16
  • It can perhaps also be mentioned that the (albeit commercial) hashtwo vmod allows purging (instead of ban-ing) to be done with such dependencies. High volume of bans (100+ per second) does not scale well. – lkarsten May 02 '14 at 13:35
  • Thanks for the tip, didn't know about that one. But when you say high volume of bans does not scale well, it's also worth saying that a high number of affected objects by purge does not scale well. In the end it's amount of requests (bans, purges) and amount of affected objects that decides which one is more efficient. – Clarence May 03 '14 at 09:59