
How removing caching improved mobile performance by 25% - thijser
https://engineering.klarna.com/how-removing-caching-improved-mobile-performance-by-25-52a17cc339a2#.j5r34xnim
======
tyingq
Well, specifically removing the html5 offline application cache if you don't
need offline functionality.

That it causes duplicate requests, and apparently more of them in chrome
mobile than other browsers, is interesting though.

~~~
dalanmiller
Agreed ^ this title is a big misleading / clickbaity

~~~
tyingq
Not sure why they went that way either..."Offline Cache Causes Duplicate Asset
Downloads" would have caught my attention just fine.

~~~
disconnected
Not a web technology expert, but apparently the appcache feature is deprecated
([https://developer.mozilla.org/en-
US/docs/Web/HTML/Using_the_...](https://developer.mozilla.org/en-
US/docs/Web/HTML/Using_the_application_cache)) _and_ this dead horse has
already been beaten to... er, death? before
([http://alistapart.com/article/application-cache-is-a-
doucheb...](http://alistapart.com/article/application-cache-is-a-douchebag)).

I could be missing something, though.

EDIT:

Forgot to mention that both links come straight from that article.

~~~
the_duke
Service workers are the way to go now.

~~~
smhg
But they aren't available in Safari.

And on mobile, where appcache should be most relevant, Safari can have a
significant market share.

~~~
TurningCanadian
They'll come around. And in the meantime, at least Chrome users can benefit.

~~~
kevlened
Until they come around, all iOS users are without service workers, because
Chrome on iOS is backed by WKWebView [1]. AFAIK, any custom browser on iOS is
required to use WKWebView.

[1] [http://stackoverflow.com/questions/29895387/service-
workers-...](http://stackoverflow.com/questions/29895387/service-workers-and-
ios)

~~~
EGreg
I want Web Push!!

------
modeless
> Never use the application cache (or service workers) unless you actually
> need offline features.

I disagree. Appcache is deprecated and you should never use it under any
circumstances. On the other hand, service workers are cool and there are
reasons to use them even if you don't need offline features.

~~~
mschuster91
Safari does not support Service Workers AT ALL, so not using AppCache
effectively kills offline support for iOS (source:
[https://jakearchibald.github.io/isserviceworkerready/](https://jakearchibald.github.io/isserviceworkerready/)).
Also, according to
[http://caniuse.com/#feat=serviceworkers](http://caniuse.com/#feat=serviceworkers),
IE/Edge as well as Safari Desktop and Android 4.x do not support AppCache
(compared to near-universal support for AppCache,
[http://caniuse.com/#feat=offline-apps](http://caniuse.com/#feat=offline-
apps)). This means: use AppCache or lose offline on anything that's not
FF/Chrome (on desktops, offline doesn't even matter that much!) or the newest
Android.

Also, the Service Worker API just plainly sucks when compared with AppCache
Manifests. It's a real pity that AC is going down the drain.

~~~
mbrock
The Service Worker API is very general so it's like a one time cost of
implementing something like the AC manifest using the API.

~~~
chj
This, and IndexedDB API are ugly. Any recommendations on wrapper libraries?

~~~
Cozumel
Dexie is good. [http://dexie.org/](http://dexie.org/)

------
xenadu02
Since when is only testing in Chrome an acceptable way to develop web
applications?

I wish the author had shown us some other browser results. I'm curious if the
iframe changes affected Safari, Firefox, or Edge. (Others have noted that app
cache is deprecated).

~~~
hamandcheese
Compared to Chrome the Safari dev tools are downright embarrassing.

~~~
hamandcheese
To clarify, I'm not arguing that it's okay to test only in chrome, merely
offering up a reason why that is so commonly the case.

------
power78
This article just displays the author's lack of knowledge of the subject
matter he is developing with. Something tells me it was written just to get
the company's name out there.

~~~
hamandcheese
There's no shame in not being an expert.

And isn't getting their name out there the point of a company blog?

~~~
Cozumel
Not when it demonstrates such technical incompetence.

------
sp332
Did you know you can use Firefox Developer Tools to remotely debug mobile
Chrome? It's still in heavy development, but I'm guessing it's easier than
trying to quiesce browser activity and tease out network events manually.
[https://developer.mozilla.org/en-
US/docs/Tools/Valence](https://developer.mozilla.org/en-US/docs/Tools/Valence)

------
calvin0
Did this have any improvement on the conversion rate?

------
thinkloop
Is this considered a bug in appcache (deprecation aside)? Why would it
download twice at all?

~~~
mfukar
Yeah I missed this completely as well. Two requests for each resource because
of the two iframes ("main" and "fullscreen")? It seems to me there's a huge
logical leap between "..we were unknowingly downloading much more content than
was necessary" and the next paragraph - probably just my unfamiliarity with
webdev.

~~~
ctaintor
In the image on the article, you'll see that I pointed at a duplicate loading
of fullscreen.css. If appcache weren't loading this in parallel, it would only
be loaded once (by the fullscreen iframe).

~~~
mfukar
I noticed the duplicate downloads. After all, they're the entire premise
behind the investigation. But _why_ does appcache download _already requested_
assets?

