WAF-PERF-110 β Caching strategies MUST be defined for workloads with repeated read patterns or latency-sensitive endpoints
Description
Workloads serving repeated content MUST use edge caches (CDN), application caches, or in-memory stores. Cache invalidation and TTL policies MUST be documented and aligned with data freshness requirements. Latency-sensitive APIs MUST define cache-control headers or use managed cache layers. Cache hit ratios and latency percentiles MUST be monitored.
Rationale
| Risk | Description |
|---|---|
Risk |
Uncached repeated requests overload backends and increase latency without business value. |
Risk |
Missing cache invalidation strategies can serve stale or incorrect data to users. |
Requirements
-
Workloads serving repeated content MUST use edge caches (CDN), application caches, or in-memory stores.
-
Cache invalidation and TTL policies MUST be documented and aligned with data freshness requirements.
-
Latency-sensitive APIs MUST define cache-control headers or use managed cache layers.
-
Cache hit ratios and latency percentiles MUST be monitored.
Implementation Guidance
-
Document the requirement in a version-controlled policy, ADR, or standard.
-
Assign ownership and establish a review cadence (e.g., quarterly).
-
Implement the required configuration as code in Terraform or equivalent IaC.
Maturity Levels
| Level | Name | Criteria |
|---|---|---|
L1 |
Ad hoc β control not consistently applied |
* Die Anforderung ist nicht einheitlich umgesetzt; Nachweis existiert nur punktuell oder fehlt. |
L2 |
Standardised β policy defined and communicated |
* Eine dokumentierte Policy oder ein Standard beschreibt die Anforderung. |
L3 |
Integrated β automated validation in CI/CD |
* Terraform-Checks oder IaC-Gates prΓΌfen die Anforderung automatisch in CI/CD. |
L4 |
Auditable β metrics and exceptions tracked |
* Abdeckung, Ausnahmen und QualitΓ€tsmetriken werden quartalsweise berichtet. |
L5 |
Optimised β continuous improvement based on data |
* Die EffektivitΓ€t wird kontinuierlich gemessen und automatisch optimiert. |
Checks
waf-perf-110.tf.aws.cloudfront-cache
Engine: terraform | Provider: aws | Automated: Yes
AWS CloudFront distributions must define default cache behavior
AWS CloudFront distributions must define default cache behavior
Scope: resource β aws_cloudfront_distribution
Assertions:
* default_cache_behavior attribute_exists β CloudFront must define default cache behavior.
Remediation: AWS CloudFront distributions must define default cache behavior
# Example compliant with waf-perf-110.tf.aws.cloudfront-cache
# Example non-compliant with waf-perf-110.tf.aws.cloudfront-cache
waf-perf-110.tf.azurerm.cdn-endpoint
Engine: terraform | Provider: azurerm | Automated: Yes
Azure CDN endpoints must have origin host header and compression configured
Azure CDN endpoints must have origin host header and compression configured
Scope: resource β azurerm_cdn_endpoint
Assertions:
* origin_host_header attribute_exists β CDN endpoint must have origin host header configured.
Remediation: Azure CDN endpoints must have origin host header and compression configured
# Example compliant with waf-perf-110.tf.azurerm.cdn-endpoint
# Example non-compliant with waf-perf-110.tf.azurerm.cdn-endpoint
waf-perf-110.config.cache-adr
Engine: config | Provider: any | Automated: No
Caching strategy must be documented in architecture decision record
Caching strategy must be documented in architecture decision record
Scope: file β docs/adr/*.md
Assertions:
* exists attribute_exists β At least one ADR must document caching strategy.
Remediation: Caching strategy must be documented in architecture decision record
# Example compliant with waf-perf-110.config.cache-adr
# Example non-compliant with waf-perf-110.config.cache-adr
Evidence
-
Terraform configuration implementing the requirement.
-
Policy, ADR, or standard documenting the requirement.
-
Optional cloud console or API output confirming runtime state.
Related Controls
-
WAF-OPS-040 == Regulatory Mapping
-
AWS Well-Architected Framework: PERF 04 β Optimize data patterns and usage
-
Azure Well-Architected Framework: Performance Efficiency β Caching
-
Google Cloud Architecture Framework: Performance Optimization β Caching and content delivery