Skip to content

maxHeaderSize default of 8192 is too big, because it doesn't include the header field nameΒ #441

@jpmschuler

Description

@jpmschuler

Bug Report

Current Behavior
If you have too many cache tags, the tags are truncated after 8192 characters, however the line in the generated .htaccess-file is then

				Header set X-SFC-Tags "<truncated cache tags>"

which adds 28 characters and results in 8220 characters.
If that URL is accessed in the frontend an core:alert with Error reading /path/to/tx_staticfilecache/domain_443/path/to/page/.htaccess at line 14: Line too long is resulting in a HTTP error 500.

Online I found mentions that there is a max line length of 8190 characters for .htaccess files. I couldn't find a docs link for that, but this number repeats in many header relevant stuff.

Reducing that .htaccess line by a few chars resolves the error

Expected behavior/output

Environment

  • TYPO3 version(s): 12
  • staticfilecache version: 13.1.3

Possible Solution
adapt maxHeaderSize defaults and the hardcoded fallback value at

$maxHeaderSize = (int) ($configurationService->get('maxHeaderSize') ?? 8192);
from 8192 to e.g. 8100 to take into account the header attribute name as well and not only the payload.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions