Categories


Archives


Recent Posts


Categories


Fixing X-Magento-Tags too Large Errors

astorm

Frustrated by Magento? Then you’ll love Commerce Bug, the must have debugging extension for anyone using Magento. Whether you’re just starting out or you’re a seasoned pro, Commerce Bug will save you and your team hours everyday. Grab a copy and start working with Magento instead of against it.

Updated for Magento 2! No Frills Magento Layout is the only Magento front end book you'll ever need. Get your copy today!

Over in my patreon slack room (the semi-private slack where I help patrons with their programming questions), a patron wan running into an issue where Magento catalog/category pages were generating an X-Magento-Tags HTTP header that was “too large”. They’d managed to track this down to a GitHub issue from this summer. Unfortunately, the issue had been closed by a Magento core repo maintainer without much effort to reproduce the problem (“works on my machine” is alive and well in 2020).

Even though I don’t do much paid Magento work these days, it’s nice to have a small following of smart folks who are doing Magento work. My pinging the issue thread attracted some attention with two possible solutions: One team worked around this by giving up the cache invalidation functionality that X-Magento-Tags enables. Another bumps up their varnish and nginx max header and request sizes on every project as a matter of course.

Over on Twitter I was able to get a quick high level overview of why Magento wanted to set these headers, a link to an open source module that offers a workaround, and another suggestion of which varnish and nginx configurations would help. I cried a single tear that no one mentioned the corresponding apache settings like LimitRequestFieldSize.

Magento have known about this issue since 2016. It seems strange they haven’t taken steps to improve on the initial naive implementation with more efficient storage of the header value, or maybe hashing it and creating a hash/IDs lookup table. I suppose anything that makes it easier to run Magento 2 yourself has trouble getting worked on these days.

Copyright © Alana Storm 1975 – 2023 All Rights Reserved

Originally Posted: 31st January 2020

email hidden; JavaScript is required