Bug 239093 - Different caching behavior for .wasm files when refreshing with the reload button
Summary: Different caching behavior for .wasm files when refreshing with the reload bu...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Page Loading (show other bugs)
Version: Safari 15
Hardware: All macOS 12
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-11 15:52 PDT by Susan Wang
Modified: 2022-06-25 15:18 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Susan Wang 2022-04-11 15:52:28 PDT
Using this page as an example, https://www.figma.com/file/z1Q0Jea05gibeGQyasrJd6/TEST?node-id=0%3A1 
This page fetches two .wasm files from network.

When I press the reload button rightmost of the address bar, the caching for these two files differ. 

In my testing, one of them always caches, on disk. But the other one never caches. All js resources would cache. 
My iPhone 7 has the same behavior -- I saw the same pattern when I'm inspecting from the 'Develop' menu in my Desktop Safari when connected to my phone.

Occasionally, from a fresh tab, when I reload using the reload icon, both files are fetching from memory for the first time, but subsequent refreshes would miss again. 
This behavior sounds extremely similar to another user's observation: https://developer.apple.com/forums/thread/125224, search for "Should I log a bug for this".

For both Desktop and iPhone, when I click and enter from the address bar directly, however, the two .wasm files would be cached.

When I open the file in private browsing on desktop, I noticed that these two .wasm files never cache when I reload with the reload icon.

It is surprising to me that in the non-private browsing case, the browser caches the .wasm files differently, when they are served with the exact same cache control headers from the same server. 
Moreover, the js resources would always cache. Are js files treated differently from the .wasm file type?

I'm on Safari Version 15.2, macOS Monterey 12.1. 
The iPhone I mentioned is an iPhone 7, Safari Version 15.3 (inferred from the user agent string).
Comment 1 Radar WebKit Bug Importer 2022-04-18 15:53:13 PDT
<rdar://problem/91923397>
Comment 2 Yusuke Suzuki 2022-06-25 15:17:31 PDT
Can you upload these two different wasm files?
Comment 3 Yusuke Suzuki 2022-06-25 15:18:23 PDT
(In reply to Yusuke Suzuki from comment #2)
> Can you upload these two different wasm files?

Ah, I misunderstood. I think this is rather networking related thing.