alengo/sulu-http-cache-bundle
Integrates HTTP caching with Sulu CMS to speed up sites and reduce backend load by caching responses at the HTTP layer. Configure cache behavior for Sulu content and deliver faster, more scalable pages.
alengo/sulu-http-cache-bundle targets HTTP caching optimizations for Sulu CMS (Symfony-based) by:
?utm_source) to avoid cache pollution.HttpCacheStore). Fits into Sulu’s Symfony-based architecture.HttpCache middleware) and reverse proxies (Varnish/Nginx). Requires minimal changes to existing caching strategies.Referer header before trusting cache/attribution decisions, reducing cache-poisoning and forged-referer risk.kernel.request, kernel.response).sulu_http_cache in config/packages/ and configure proxy rules.sulu_http_cache:
tracking_params: ['utm_source', 'utm_medium'] # Strip these
proxy_cookies: ['_ga', 'marketing_attribution'] # Handle at proxy
| Risk | Mitigation |
|---|---|
| Proxy Misconfiguration | Validate proxy rules (e.g., Varnish VCL) before deployment. |
| Cache Invalidation | Ensure stripped params don’t break existing cache tags (e.g., ESI includes). |
| Cookie Handling | Test edge cases (cookie expiration, domain restrictions). |
| Sulu Version Drift | Monitor Sulu’s Symfony version support; may need backports. |
| Performance Overhead | Benchmark with/without bundle to confirm caching improvements. |
| Stricter Referer Validation (1.0.0) | Previously-accepted requests with missing/odd referers may now be rejected or treated as uncacheable — regression-test traffic shapes before rollout. |
| Cookie Payload Rejection (1.0.0) | Legitimate-but-oversized or legacy-encoded attribution cookies may be dropped — audit current cookie formats in production. |
| Pattern Compilation Behavior (1.0.0) | Existing config patterns that previously compiled may now fail-fast — validate all configured patterns during CI. |
| Upgrade Ambiguity | 1.0.0 is the first stable cut; treat pre-1.0 → 1.0.0 as a minor-breaking upgrade and pin exact versions. |
proxy_cache.HttpCache or Varnish cache.composer require alengo/sulu-http-cache-bundle:^1.0
composer update in a staging branch, review the changelog and diff for referer/cookie/pattern logic.config/bundles.php.sulu_http_cache in config/packages/sulu_http_cache.yaml.tracking_params / proxy_cookies patterns via a CI lint step.sub vcl_deliver {
if (obj.http.X-Sulu-Cache-Stripped) {
unset beresp.http.Set-Cookie; // Let bundle handle cookies
}
}
SuluHttpCacheEventSubscriber for param stripping, referer validation, and cookie payload rejection.curl or varnishlog; include forged-referer and oversized-cookie cases.proxy_cache_key and add_header directives.README or wiki.SuluHttpCacheEvents for troubleshooting (e.g., kernel.response).varnishlog, Nginx error logs) for edge issues.wrk).| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Proxy misconfiguration | Broken cookie handling | Canary deploy proxy rules. |
| Bundle disabled | Tracking params leak into cache | Fallback: Manual param stripping in middleware. |
| Symfony upgrade conflict | Bundle incompatibility | Test in staging; fork if needed. |
| Cookie injection errors | Marketing data loss | Log errors; alert team. |
| Cache stampede | Increased backend load | Adjust Varnish ban rules. |
| Stricter referer rejection (1.0.0) | Legitimate traffic treated as uncached; attribution gaps | Baseline referer shapes; configure allow-list; monitor rejection rate. |
| Cookie payload rejection (1.0.0) | Legacy/oversized attribution cookies dropped | Audit live cookie formats; normalize upstream before upgrade. |
| Pattern compile failure (1.0.0) | Bundle fails closed on bad config at boot | Lint patterns in CI; fail the build, not production. |
| Overly permissive referer config | Cache-poisoning window reopened | Keep strict allow-lists; review during config changes. |
Cache-Control headers).How can I help you explore Laravel packages today?