Closed Bug 783851 Opened 12 years ago Closed 12 years ago

Put Expires & Cache-control headers on our css/js pages

Categories

(developer.mozilla.org Graveyard :: Editing, defect, P2)

x86
macOS
defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: teoli, Unassigned)

References

Details

The following css pages are loaded from each page:

mdn-min.css?build=dcfe923
wiki-min.css?build=dcfe923
wiki-print-min.css?build=dcfe923

They are "revved" with the dcfe923 build id. That means that each time one of them change, they have a different URL. In other words, each URL has a content that *never* change.

Right now, each page load make a CONDITIONAL GET to get them, always resulting in a 304 NOT MODIFIED. By putting an expiration date (w/ Expires: and Cache-control: HTTP headers) in the far future (1 year, or 10 year) we will save these 3 requests.

This will speed our primed cache page load as layout calculation only starts once the css are loaded.
Depends on: 783852
Once revved (see 783852), mdn-print.css should be added to that list.
And the same can be done to our js pages:

https://developer.mozilla.org/media/js/mdn-min.js?build=dcfe923
https://developer.mozilla.org/media/js/wiki-min.js?build=dcfe923
Summary: Put Expires & Cache-control headers on our css pages → Put Expires & Cache-control headers on our css/js pages
And on:
https://developer.mozilla.org/en-US/jsi18n/build:dcfe923 which also is a js script.
As you put (great idea!) the async html attribute on all external scripts (that are the longest to load and blocking further parsing), this is now blocking a win of 0.4-0.6s load time on a _primed_ cache, which is about 10-18% of the total loading times on 95% of the wiki pages.

Especially as in modern servers the persistent connections are limited to 5s max, meaning that we reestablish the 6-10 https connections just to get 304 Not Modified answers…

( Template:CustomCSS need to be fixed too to see the net win)
Priority: -- → P2
Version: Kuma → unspecified
Component: Docs Platform → Editing
Depends on: 792974
Depends on: 799155
This has been fixed when we migrated to a CDN.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.