I have an install where all authentiated requests are served from a different subdomain than anonymous, and only auth users can vote or comment. This means that when comments/nodes/votes etc. are posted, the cache is flushed for foo-secure.example.com instead of www.example.com, which isn't very useful.

The only two places that _varnish_get_host() is used currently are in hook_expire() and varnish_purge_all_pages(), since those both need the host where the cache is set, not where it's being cleared from, I think it makes sense to add a variable for this.

What this wouldn't cover is the situation where you have a multilingual site using domain prefixes, or a site using domain access - where the same content is served via separate domains. That might need to allow this variable to be an array in that case, but I haven't thought about this too much yet.

CommentFileSizeAuthor
varnish_cache_base_url.patch1.48 KBcatch

Comments

catch’s picture

Status: Needs review » Closed (duplicate)