ampproject / ampproject/amp-sw
AMP HTML documents handled via NetworkFirst strategy
- Dominant language
- JavaScript
- Stars
- 70
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Description
Hi amp-sw community, I've noticed that the current logic of amp-sw might cause a FCP regression on AMP sites using HTTP caching on HTML documents but also using amp-sw "as is".
Below a screenshot for amp.dev showing that page refresh requests seems treated as Network First, always downloading the HTML document from Network.

If this is triggered by the enablement of an offline page I would suggest to switch to a CacheFirst strategy instead, maybe with a customisable max-age as safe lock or just relying on the SW versioning for caching.
FCP should improve significantly on sites using amp-sw with this strategy change.
Contributor guide
Research direction
The issue names no files, tests, or entry points. Start by tracing how AMP HTML document requests are assigned their current NetworkFirst strategy, then verify the behavior with HTTP-cached pages and the offline-page path. Done means the strategy change is intentional, configurable if needed, and improves refresh FCP without breaking offline behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- performance, web-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100