sunknudsen
sunknudsen

Reputation: 7310

Why does Safari on mobile take so long to load images from memory?

A strange performance issue occurs on Safari (iOS 13.5.1).

Loading images from memory takes over 300ms resulting in animation hanging (and image is not shown during animation).

When using Safari on desktop (macOS Catalina 10.15.7), load time is 3ms.

What can cause this issue?

Safari

Console

Edit: here are additional screenshots.

Requests

Animation requests

Animation requests headers

Upvotes: 3

Views: 641

Answers (1)

sunknudsen
sunknudsen

Reputation: 7310

Figured it out!

Apparently Safari handles caching differently on desktop vs mobile.

My server was serving images with a no-cache polity (Cache-Control: public, max-age=0).

Changing policy to Cache-Control: public, max-age=31536000 fixed the issue.

Upvotes: 2

Related Questions