ampproject / ampproject/amp-sw

AMP HTML documents handled via NetworkFirst strategy

Open
#70 7 comments 0 reactions 0 assignees View on GitHub
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.
![unnamed](https://user-images.githubusercontent.com/329023/104289961-06d1e000-54ba-11eb-9265-81fc57a2333e.png)

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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.