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

caches cors preflight request for 10 min #68

Merged
merged 1 commit into from
Oct 5, 2017
Merged

Conversation

edda
Copy link
Contributor

@edda edda commented Oct 5, 2017

Cache the result of the preflight request for 10 minutes so the browser doesn't do a preflight request every time. This'll speed up the api calls since it won't do two requests every time.

@databus23
Copy link
Member

Makes sense I would even set it to a higher value. 6 hours or more. Our CORS rules are static and are not going to change frequently.

@edda
Copy link
Contributor Author

edda commented Oct 5, 2017

Yeah, I wanted to set it to 24 hours but apparently many browsers don't allow high values for this. Chrome e.g. seems to allow a maximum of 10 minutes. Something about possibililty of cache poisoning. So I figured I'll use a value that is hopefully respected by all browsers to get similar behaviour across browsers. But I don't mind using a longer time and see what happens...

@databus23
Copy link
Member

ok 10 minutes it is.

@databus23 databus23 merged commit 2026e98 into master Oct 5, 2017
@databus23 databus23 deleted the cors-config branch November 10, 2017 09:03
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

Successfully merging this pull request may close these issues.

2 participants