ostark / upper

Integrates Edge Caches like Fastly, KeyCDN, Cloudflare and Varnish with Craft.
MIT License
102 stars 22 forks source link

Config setting to truncate header length #66

Closed timkelty closed 12 months ago

timkelty commented 2 years ago

On large pages, it is possible that the XKEY/Surrogate-Key/Cache-Tag exceeds the allowed length of a header by the web server. IIRC, when this happens, it is generally not handled gracefully and you might get a fatal error from the web server.

I remember when I dealt with this, I had to go an bump the value in nginx and Varnish.

It would be nice if Upper had a config setting to automatically truncate the header, before it was output, to prevent this.

It could have a reasonable default set to whatever nginx or apache uses.

ostark commented 2 years ago

https://github.com/ostark/upper/blob/master/src/config.example.php#L25-L30 👀

timkelty commented 2 years ago

well then!

ostark commented 2 years ago

Adding a reasonable default limit makes sense.