content_translation_page_attachments() adds alternate links to the html head, which is fine. However these links also end up in the response headers (I honestly don't really understand why we do that). Now, when there are too many languages (in our case, we're working with 47), varnish will crash with a 503.

-   BogoHeader     Too many headers: Vary: Accept-Encodin
-   HttpGarbage    "HTTP/1.1%00200%00OK%00%0aDate: Fri, 28 Apr 2017 12:54:20 GMT%00%0aServer: Apache/2.4.12 (Ubuntu)%00%0aX-Powered-By: PHP/5.6.20%00%0aCache-Control: must-revalidate, no-cache, private%00%0aLink: <http://127.0.0.1:6081/en/handbook>; rel="alternate"; hreflang="en"%00%0aLink: <http://12%00"
-   BerespStatus   503
-   BerespReason   Service Unavailable
-   FetchError     http format error
-   BackendClose   17 default(127.0.0.1,,80)
-   Timestamp      Beresp: 1493384064.185137 3.703384 3.703163
-   Timestamp      Error: 1493384064.185146 3.703393 0.000010
-   BerespProtocol HTTP/1.1
-   BerespStatus   503

I've altered out these alternate links for now with hook_module_implements_alter(). But we shouldn't send those to varnish IMO.

/**
 * Implements hook_module_implements_alter().
 */
function module_module_implements_alter(&$implementations, $hook) {
  if ($hook == 'page_attachments') {
    unset($implementations['content_translation']);
  }
}

Comments

swentel created an issue. See original summary.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

swentel’s picture

Component: content_translation.module » base system

Actually this not related to content translation alone - I think we should really stop sending any rel link along with the headers.

Moving to another component for now to get more discussion.

ekes’s picture

Noticed Acquia suffering this one https://library.acquia.com/article/varnish-header-limits as will everyone who can't change their Varnish runtime parameters https://www.varnish-cache.org/docs/5.0/reference/varnishd.html#run-time-...

andypost’s picture

that affects nginx as well, requiring to increase buffers

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.