Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Status of cached files is excluded #24

Open
ghost opened this issue Oct 10, 2016 · 9 comments
Open

Status of cached files is excluded #24

ghost opened this issue Oct 10, 2016 · 9 comments

Comments

@ghost
Copy link

ghost commented Oct 10, 2016

Status 304 is excluded for XMLHttpRequests. This will give an error when retrieving a cached file.

@davidyack
Copy link
Owner

Currently we aren't supporting the If-Match yet on a Get to support checking for a change - I assume that is what you are after? Can we change the title of this to "Support conditional retrievals" I would like to see this added in a future update

@ghost
Copy link
Author

ghost commented Oct 10, 2016

I'm refering to this. you check in boundries of 200-299 but 304 for cached data would be ok as well.

req.onreadystatechange = function () {
            if (this.readyState == 4 /* complete */ ) {
                req.onreadystatechange = null;
                if ((this.status >= 200) && (this.status < 300)) {
                    callback(false, {
                        'response': this.response,
                        'headers': self.parseResponseHeaders(this.getAllResponseHeaders())
                    });
                } else {
                    callback(true, this)
                }
            }
        };

@davidyack
Copy link
Owner

Yes, right now I don't believe there a way we can encounter a 304 until we expose a way to do conditional retrievals - So agree when we add logic to support that we will need to expand to support 304 being returned

re - http://docs.oasis-open.org/odata/odata/v4.0/os/part1-protocol/odata-v4.0-os-part1-protocol.html#_Toc372793647

@ghost
Copy link
Author

ghost commented Oct 10, 2016

But what if cache control is added in the response header? like Cache-Control:public, then the browser could cache.

@davidyack
Copy link
Owner

That is a good question I've not seen anything one way or the other - have you seen something that would indicate that would also return a 304, seems like that would conflict with the ability to do the conditional retrieval check if it interfered no?

@ghost
Copy link
Author

ghost commented Oct 10, 2016

If you have the devtools open and watch the status of for example webresources they will turn to 304 if you reload sometimes. But don't forget to uncheck "disable cache if devtools are open" IE and chrome behave differently of course.
Some elements have cache control public some have private some an etag it is not very consistant.

@davidyack
Copy link
Owner

Yeah I agree the web resources or any JS file etc will be impacted, but have you seen this on a Web API get request?
Thx
Dave

@ghost
Copy link
Author

ghost commented Oct 10, 2016

well, yes, since I retrieve webresourse sometimes like that :D

@davidyack
Copy link
Owner

ok, will research a little more- either way should add 304 when we add conditional, just want to understand if there are other scenarios that will return it that need to be considered

thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant