Bug 187726 - Web Inspector: Disable Cache doesn't affect preloaded content
Summary: Web Inspector: Disable Cache doesn't affect preloaded content
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: Safari Technology Preview
Hardware: All All
: P2 Normal
Assignee: Nobody
Keywords: InRadar
Depends on:
Reported: 2018-07-17 04:58 PDT by Martin Häcker
Modified: 2019-01-30 06:57 PST (History)
7 users (show)

See Also:

screenshot (121.89 KB, image/png)
2018-07-17 04:58 PDT, Martin Häcker
no flags Details
code and video of reproduction (4.95 MB, application/zip)
2018-07-17 12:06 PDT, Martin Häcker
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Häcker 2018-07-17 04:58:29 PDT
Created attachment 345151 [details]

I've just noticed that `<link rel=preload ...>` content seems to completely ignore the 'disable cache' button in the webkit inspector.

This has the effect that on my development system I frequently get out of date data when working with javascript. Which is quite annoying.

See attached screenshot for an illustration of the problem.
Comment 1 Martin Häcker 2018-07-17 05:00:03 PDT
What I have in the html to load the script is this:

`<link rel="preload" as="script" href="/static/additional.js" />`

as well as

`<script src="/static/additional.js"></script>`
Comment 2 Brian Burg 2018-07-17 08:38:26 PDT
Are you able to reproduce this in a standalone test case? That would really help us to isolate and fix the issue.
Comment 3 Radar WebKit Bug Importer 2018-07-17 08:40:11 PDT
Comment 4 Martin Häcker 2018-07-17 12:06:32 PDT
Created attachment 345179 [details]
code and video of reproduction
Comment 5 Martin Häcker 2018-10-16 02:05:43 PDT
Hello @maintainers: any progress on this? This is _mightiliy_ annoying when trying to develop with Safari on a page that uses preloaded content. As far as I can tell neither Firefox nor Chromium behave this way, so I would be very surprised if this works as intended.

Also, does my reproducer work for you? Do you need more input?
Comment 6 Martin Häcker 2018-10-16 02:10:50 PDT
Some more info I can add from my testing: If a page preloaded a script it seems
* I can not reload any other page from the same site to get a new version of the script
* Emptying the cache (command-alt-e) doesn't trigger a reload of the script
* Force Reloading (command-alt-r) doesn't trigger a reload of the script.

What we do:
* We have an entry page that contains the preload statements
* all other pages just reference the scripts as usual
Comment 7 Oliver Joseph Ash 2019-01-17 05:33:55 PST
I opened a new issue for this: https://bugs.webkit.org/show_bug.cgi?id=193533, as the bug is not specific to the "Disable Cache" feature in the web inspector.

If a request is preloaded, Safari will always retrieve it from the cache, regardless of the cache headers for that request.