# CloudFront Cache Policy Update - www.redtag.ca

**Date**: 2026-05-01
**Distribution**: E2A4NV8O3YO1LX (www.redtag.ca - Adobe AEM CDN)
**AWS Account**: 489176460030 (tbi-prod)

## Change Summary

Replaced the managed CloudFront cache policy with a custom policy to reduce maximum cache TTL from 1 year to 1 hour, reducing the need for frequent manual cache invalidations.

## Before

| Setting | Value |
|---------|-------|
| Policy | `UseOriginCacheControlHeaders-QueryStrings` (AWS managed) |
| Policy ID | `4cc15a8a-d715-48a4-82b8-cc0b614638fe` |
| MinTTL | 0s |
| DefaultTTL | 0s |
| MaxTTL | 31536000s (1 year) |

## After

| Setting | Value |
|---------|-------|
| Policy | `Custom-OriginCacheControl-QueryStrings-1hr` |
| Policy ID | `8f5aba92-0668-4aa2-8f7c-85318487f4e8` |
| MinTTL | 0s |
| DefaultTTL | 0s |
| MaxTTL | 3600s (1 hour) |

## Cache Key Settings (unchanged)

- **Headers**: x-method-override, origin, host, x-http-method, x-http-method-override
- **Cookies**: All
- **Query strings**: All
- **Compression**: Gzip + Brotli enabled

## Reason

Origin (cdn.adobeaemcloud.com) returns long `Cache-Control` max-age values. With the managed policy's 1-year MaxTTL, content updates required manual CloudFront invalidations. Capping MaxTTL at 1 hour ensures content refreshes automatically within a reasonable window.

## Rollback

To revert, update the distribution's default cache behavior to use the original managed policy:

```bash
# Policy ID for UseOriginCacheControlHeaders-QueryStrings
4cc15a8a-d715-48a4-82b8-cc0b614638fe
```
