Skip to content

Integrate cache policies with runtime shared caches #908

Description

@ChristianPavilonis

Summary

Make Trusted Server cache policies effective through each runtime's actual shared-cache mechanism and move platform-specific cache rendering behind the EdgeZero adapter boundary.

PR #860 emits typed browser and runtime-specific edge-cache headers. Cloudflare Workers Cache can consume the emitted Cloudflare-CDN-Cache-Control header when enabled, but Fastly synthetic/egress responses still need explicit cache integration. Core handlers also hand-thread a platform constant that belongs at the runtime boundary.

Scope

  • Fastly:
    • choose and implement Core Cache/Simple Cache for synthetic responses such as TSJS;
    • apply appropriate backend cache overrides for proxied responses;
    • verify TTL and privacy/bypass behavior.
  • Cache keys:
    • prove /static/tsjs= shared-cache keys preserve the v query parameter;
    • prevent versioned immutable and missing/mismatched short-TTL responses from colliding.
  • EdgeZero/runtime abstraction:
    • own platform edge-cache header names and CachePolicy rendering at the adapter boundary;
    • remove hand-threaded EdgeCacheHeader constants from Trusted Server core signatures.
  • Cloudflare:
    • verify Workers Cache hit/bypass behavior;
    • upgrade compatibility_date separately with integration coverage.

Acceptance criteria

  • Versioned TSJS responses are demonstrably stored and hit in each production shared cache.
  • Missing/mismatched TSJS versions retain short TTLs and cannot share a key with matching versions.
  • Private, no-store, and cookie-bearing responses bypass shared storage.
  • Platform-specific cache rendering is owned by EdgeZero adapters rather than core handlers.
  • Fastly and Cloudflare integration tests cover the runtime behavior.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions