Closed (fixed)
Project:
Varnish
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Reporter:
Created:
22 Oct 2015 at 07:31 UTC
Updated:
14 Oct 2020 at 14:13 UTC
Jump to comment: Most recent, Most recent file
When you use a specific domain name to contribute and an other for anonymous users, the ban command is sent only for contributors
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | varnish-multidomain-2598824-14.patch | 1.77 KB | jyrkih |
| #5 | varnish-multidomain-2598824-4.patch | 1.77 KB | mjeannin |
| #2 | varnish-multidomain-2598824-D7.patch | 1.77 KB | mjeannin |
Comments
Comment #2
mjeannin commentedComment #3
SebCorbin commentedSpace at line ends and spaces needed between operator/parenthesis, etc. See https://www.drupal.org/coding-standards
The description states that the default will be backoffice domain, but 'front.com' is used.
You should get it from
$GLOBALS['base_url'](with http(s) stripped from it).Same thing here, so that the module could run even when not configured
No need to iterate over references
Comment #4
SebCorbin commentedComment #5
mjeannin commentedComment #6
mjeannin commentedComment #7
SebCorbin commentedOk so now it's more clear: front-end domain are optional, varnish will work even if no domain is set.
Typo here but otherwise it works for me
Comment #8
Anthony Hyvert commentedThanks for the reply.
Do you when this patch will be integrate to the module ?
Comment #9
misc commentedThe patch #5 does not apply to dev, could somebody with more time than me update it?
Comment #10
misc commentedComment #11
jlatorre commentedPatch #5 worked for me on latest 7.x-dev version
Comment #12
jlatorre commentedComment #13
cesarmiquel commentedPatch #5 worked like a charm for me. It applied cleanly with the 7.x-1.1 version which was released a couple of days ago.
Comment #14
jyrkih commentedPatch #5 seems to fail if variable varnish_front_domains is empty. Adding a patch which makes an extra check for emptiness.
Comment #15
jlatorre commentedComment #17
misc commentedNo, it was not fixed, but now it is :-) Committed to latest dev.
Comment #19
socialnicheguru commentedI have long domain names and it would be great to have a larger area to enter in
Comment #20
retorque commentedA note for the next person using this feature and encountering performance issues with long lists of domains (we made the field accept a longer list by altering it from hook_form_alter() in a custom module):
The list of domains is processed in a loop. The number of Varnish console requests will be at least number-of-domains * number-of-varnish-servers. The number of domains seems to have a bigger impact on performance than the number of Varnish servers, but both can be an issue. We had a site with 12 domains behind 4 Varnish servers, and node save was taking close to 30 seconds, even for very simple nodes.
However, the domains are also inserted into the Varnish ban command using a regular expression operator. I suspect that was intended to eliminate the need for a separate "www" entry, but it also conveniently means that you can put a list of domains in a parenthetical group and get them all processed with a single request to Varnish.
Example:
(exampleschooldistrict.org|exampleschool.org|exampleschooltwo.com|exampleschoolthree.net)