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

Set Cache-Control on rest resources #2246

Merged
merged 1 commit into from May 17, 2016
Merged

Set Cache-Control on rest resources #2246

merged 1 commit into from May 17, 2016

Conversation

@edmundoa
Copy link
Member

@edmundoa edmundoa commented May 17, 2016

Some browsers cache Ajax requests (like IE/Edge), so we need to set the Cache-Control header to no-cache to avoid caching issues.

In order to only set cache headers into requests coming from browsers, we now set the X-Requested-With header in all our XHR requests coming from the web interface.

Fixes #2243.

This PR should also be merged into master.

Some browsers cache rest requests (like IE/Edge), so we need to set the
Cache-Control header to no-cache to avoid caching issues.

In order to only set cache headers into requests coming from browsers,
we now set the X-Requested-With header in all our XHR requests.
@joschi
Copy link
Contributor

@joschi joschi commented May 17, 2016

LGTM. 👍

@joschi joschi merged commit 20c32a6 into 2.0 May 17, 2016
4 checks passed
4 checks passed
@garybot2
ci-server-integration Jenkins build graylog2-server-integration-pr 906 has succeeded
Details
@garybot2
ci-web-linter Jenkins build graylog-pr-linter-check 394 has succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@joschi joschi deleted the issue-2243 branch May 17, 2016
@joschi joschi self-assigned this May 17, 2016
joschi pushed a commit that referenced this pull request May 17, 2016
Some browsers cache rest requests (like IE/Edge), so we need to set the
"Cache-Control" header to no-cache to avoid caching issues.

In order to only set cache headers into requests coming from browsers,
we now set the X-Requested-With header in all our XHR requests.
(cherry picked from commit 20c32a6)
@edmundoa
Copy link
Member Author

@edmundoa edmundoa commented May 17, 2016

It seems that these changes also have the added benefit of removing that annoying login popup window triggered in the login page by an Ajax request.

@edmundoa
Copy link
Member Author

@edmundoa edmundoa commented May 18, 2016

Forget my last comment, that was already fixed in #2157

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

Successfully merging this pull request may close these issues.

None yet

2 participants