
Google Chrome Pages Refresh 28% Faster Because of Facebook - ryan_j_naughton
http://1reddrop.com/2017/01/28/google-chrome-firefox-pages-refresh-28-faster-facebook-video/
======
crote
The original source[0] contains the technical background anyone here is
probably looking for.

TL;DR:

\- Chrome needlessly revalidated all resources after a POST request

\- Firefox gets a "cache-control: immutable" header to indicate that a
resource will never change and thus doesn't need to be revalidated.

[0]: [https://code.facebook.com/posts/557147474482256/this-
browser...](https://code.facebook.com/posts/557147474482256/this-browser-
tweak-saved-60-of-requests-to-facebook/)

------
klodolph
"a social media company with no experience in the browser technology space"

I don't think anyone believes that Facebook has anything short of a huge
breadth of software development expertise, manpower, and initiative.

On a personal note, I'm quite happy about cache-control: immutable. All my
personal web projects embed content hashes in URIs for static resources
(except those with published URIs). This makes things a little simpler.

~~~
paulddraper
> "a social media company with no experience in the browser technology space"

Yeah, this article is sub-par HN submission.

------
netsharc
HN talked about "cache-control: immutable" a few days ago, this is like the
kindergarten version explanation of that. Not HN-worthy, IMO.

------
vjeux
Here's a more indepth technical article from Facebook:
[https://code.facebook.com/posts/557147474482256/this-
browser...](https://code.facebook.com/posts/557147474482256/this-browser-
tweak-saved-60-of-requests-to-facebook/)

~~~
ctrl_freak
The original post should be updated to point to this link.

Interesting read. Also seems like a subtle jab at Microsoft and Apple when
they said, "We're happy to have such a good working relationship with our
friends on the Chrome and Firefox teams." Conditional requests were actually
higher on IE and Safari than Firefox, so chances are they tried to engage with
those teams but were shut down?

------
grepthisab
I thought this would be a much more technical article, but it basically boiled
down to Facebook suggesting to Chrome that Chrome not reload static things.

"Technically, when you refresh a browser page, it is counted as the next visit
to that page. What Facebook did was to suggest that Chrome and Firefox only
revalidate the main resource, or the page itself, rather than images, scripts
and other resources."

------
laurent123456
I still don't really get what's so special about "cache-control: immutable".
Isn't it the same as setting the cache expiration date to something like in a
year or two? Why is a special property needed for this?

~~~
evmar
When you hit the reload button, the browsers would still revalidate resources
with long expiration dates. The fixes in the Facebook post are that Chrome
changed to no longer do this on any subresource, and Firefox changed to no
longer do this on cache-control: immutable resources.

~~~
lucb1e
I thought this was possible... that explains my frustration with "why won't
the damn thing not revalidate" when I last tried it (I think that was a few
years ago by now).

Weird though, it seems so obvious and I thought something like no-revalidate
existed. I guess I'm confusing no-cache and must-revalidate.

------
xerxes777
This is great! I mean, this was an Opera feature for 20 years, but who
cares...

------
Buge
I guess it depends on what the definition of refresh is. What do I want the
button to do when I press it, as a user? I guess only refreshing the main
html, and not cached resources is an OK design, as long as shift+refresh still
refreshes everything.

~~~
lucb1e
That question is kind of irrelevant. The immutable header is set on items that
will never ever ever change. If you expect those to get updated with a ctrl+f5
or something, you shouldn't be setting the immutable header for that item.

The only times I can imagine you want to refresh immutable items anyway is
when debugging the network: when your download was corrupted, to watch page
timings in the developer console, or when watching the traffic flow in
wireshark or something. In those cases I guess there should be a developer
option, but you specifically talked about "as a user".

~~~
tyingq
It isn't just the immutable header though. Chrome is changing existing
behavior for resources that do not have that header. AFAICT, Firefox is the
only browser with current plans for immutable.

------
tyingq
I predict quite a bit of scattered chaos when these changes roll out. Mobile
will be especially fun for help desks, as there is no obvious way to do
shift-f5 for a hard reload.

------
mrtree
HTTP PATCH but for a GET

~~~
ec109685
How is it that at all?

------
jongar_xyz
OK, so this is why I have to press shift every time I reload the app I am
developing! Great job.

~~~
Kiro
Keep DevTools open with "disable cache" in the network tab ticked.

~~~
jongar_xyz
Thank you for the tip.

