# Akamai cache optimization — DIR//LISTER # Property Manager (Ion / DSA) ## Origin headers (sent by index.php + .htaccess) ### Dynamic (HTML / API / ZIP) Cache-Control: private, no-store, max-age=0 Edge-Control: no-store, no-cache, max-age=0, downstream-ttl=0 Surrogate-Control: no-store, max-age=0 Edge-Cache-Tag: dirlister-html | dirlister-api | dirlister-download ### Static CSS/JS (?v=filemtime) Cache-Control: public, max-age=604800, stale-while-revalidate=86400 Edge-Control: !no-store, max-age=604800, downstream-ttl=604800, stale-if-error=86400, !no-transform Surrogate-Control: public, max-age=604800 Edge-Cache-Tag: dirlister-static,dirlister-assets ## Property Manager — recommended rules (order matters) 1) BYPASS DYNAMIC (priority highest) IF path = /index.php OR path = / OR query string matches api= OR login OR selftest THEN Caching → Bypass Cache Downstream Cacheability → No (optional) Remove Vary cookies from cache key — N/A when bypass 2) CACHE STATIC IF extension IN css,js THEN Caching → Cache Max Age → Honor Origin Edge-Control / Cache-Control (or force 7 days if origin not honored) Cache Key → Include entire query string *** required for ?v= busting *** Prefer HTTP/2 / compression from origin Downstream Cacheability → Allow (honor downstream-ttl) 3) CACHE MEDIA IF extension IN webp,png,jpg,jpeg,gif,svg,ico,woff,woff2 THEN Max Age 30 days Cache Key → path only (usually) ## Enable on property - Honor Origin Cache Control / Edge-Control: ON - Cache Tags: ON (for Fast Purge by tag) - SureRoute / Tiered Distribution: optional performance ## Fast Purge after deploy - By Cache Tag: dirlister-static - By URL: https://origin/index.css and index.js (and any ?v= variants if needed) ## Debug request headers (client → edge) Pragma: akamai-x-cache-on, akamai-x-cache-remote-on, akamai-x-check-cacheable, akamai-x-get-cache-key, akamai-x-get-true-cache-key, akamai-x-get-request-id ## App .env CDN_PROVIDER=akamai AKAMAI_EDGE_TTL_STATIC=604800 AKAMAI_DOWNSTREAM_TTL_STATIC=604800 AKAMAI_EDGE_TTL_MEDIA=2592000 CDN_CACHE_DEBUG=true # temporary: X-DL-CDN, X-DL-Akamai-Edge-TTL ## Do not - Cache index.php or ?api=* - Strip query strings from CSS/JS cache keys - Use “cache everything” without bypass rule for PHP