Skip to main content
100%

Gist ed0b05dfaea40fd9ccfebd9980d7bb7b

✓ Published0🌍 Public
Aalexfinnarn
Last edited Sep 15, 2023
Created on Sep 15, 2023

This example demonstrates a Drupal middleware that caps the number of cache tags in HTTP responses for specific paths, limiting them to 625 tags. It shows how to filter request paths and truncate the `edge-cache-tag` and `x-acquia-purge-tags` headers by splitting them into arrays, slicing excess tags, and re-implementing them. The code uses Symfony’s `HttpKernelInterface` and `Request` objects to intercept responses, relying on PHP’s `explode`, `array_slice`, and `implode` functions. No visualization libraries are involved; the rendering approach is purely server-side header manipulation.

AI-generated description

Similar vizzes