Ctrl+F5 (reload without cache) sends "If-None-Match" on XHR

UNCONFIRMED
Unassigned

Status

()

P3
normal
UNCONFIRMED
2 years ago
5 months ago

People

(Reporter: leyyyyy, Unassigned)

Tracking

53 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
Created attachment 8868355 [details]
Untitled.png

User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:53.0) Gecko/20100101 Firefox/53.0
Build ID: 20170504105526

Steps to reproduce:

1) Open some page which calls XHR to get html files with ETag header set.
2) Press Ctrl+F5 (Windows) to reload without cache.
3) Multiple such XHR calls should be performed to server.


Actual results:

First call is sent with no-cache... all others are sent with ETag.


Expected results:

All should be loaded without cache...
I understand it is XHR but I do not think it is by design...
All is loaded exactly after reload without cache and need to be considered as part of page load.

Updated

2 years ago
Component: Untriaged → DOM
Product: Firefox → Core
Hi Shawn, while you're working on several XHR issues recently, could you please help check what's up here? Thanks!
Flags: needinfo?(shuang)
(In reply to Maxim from comment #0)
> Created attachment 8868355 [details]
> Untitled.png
> 
> User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:53.0) Gecko/20100101
> Firefox/53.0
> Build ID: 20170504105526
> 
> Steps to reproduce:
> 
> 1) Open some page which calls XHR to get html files with ETag header set.
> 2) Press Ctrl+F5 (Windows) to reload without cache.
> 3) Multiple such XHR calls should be performed to server.
> 
> 
> Actual results:
> 
> First call is sent with no-cache... all others are sent with ETag.
> 
> 
> Expected results:
> 
> All should be loaded without cache...
> I understand it is XHR but I do not think it is by design...
> All is loaded exactly after reload without cache and need to be considered
> as part of page load.
Can you provide information about the sites you visited?
Can you explain more about the results "First call is sent with no-cache... all others are sent with ETag"?
Flags: needinfo?(shuang) → needinfo?(leyyyyy)
(Reporter)

Comment 3

a year ago
Site is not publicly available yet... As you can see in original attachment it is localhost server.

So I will try to explain better:
I have some SPA application which performs XHR to load content from server (html templates).
It is simple jquery ajax calls which executed asynchronously to load all data during "document" loading. 
These templates should be injected in DOM. Responses (serving template data) have ETag header (set by server).

In other words loading of page performs set of requests to server to get content and append it to DOM.
Depending on content app can make decision to make request to get next required templates.

So when I press Ctrl+F5 browser sends ETag for each template request except first template.
Browser thinks that next XHR after first one is not part of page loading.

Maybe it is correct behavior... maybe not.. I do not know..
Maybe the reason is impossibility to detect which XHR is part of loading SPA and which one is part of regular work...

But I guess browser can execute EVERY new XHR after Ctrl+F5 without sending ETag (just no-cache).

What do you think?
Flags: needinfo?(leyyyyy)
Flags: needinfo?(shuang)
Priority: -- → P3
Do you mind providing test cases regarding your question? I'm still not sure your question.
Flags: needinfo?(leyyyyy)
Flags: needinfo?(shuang)
Flags: needinfo?(leyyyyy)
(Reporter)

Comment 5

5 months ago
Let's close it. It happens because resources are loaded in XHR (and the same behaviour is in all browsers).
You need to log in before you can comment on or make changes to this bug.