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?

有帮助吗?

解决方案

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”
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top