Skip to content

Add long-lived cache headers for _astro/ build artifacts#197

Draft
Copilot wants to merge 3 commits into
masterfrom
copilot/add-caching-for-astro-artefacts
Draft

Add long-lived cache headers for _astro/ build artifacts#197
Copilot wants to merge 3 commits into
masterfrom
copilot/add-caching-for-astro-artefacts

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 22, 2026

Astro's content-hashed assets under _astro/ were served with no Cache-Control header, leaving caching behaviour undefined. Since filenames are immutable by construction (content hash in the name), they can be cached indefinitely.

Changes

  • docs/angular/public/web.config and docs/xplat/public/web.config: added an IIS <location> block scoped to the _astro/ directory that injects the target header:
<location path="_astro">
    <system.webServer>
        <httpProtocol>
            <customHeaders>
                <add name="Cache-Control" value="public, max-age=31536000, immutable" />
            </customHeaders>
        </httpProtocol>
    </system.webServer>
</location>

Mirrors the public, max-age=31536000 already applied to Google Fonts and other long-lived assets, with immutable added to suppress revalidation requests entirely.

Copilot AI linked an issue May 22, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add caching for _astro artefacts Add long-lived cache headers for _astro/ build artifacts May 22, 2026
Copilot AI requested a review from ChronosSF May 22, 2026 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add caching for _astro/ artefacts

2 participants