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

Conversation

Projects
None yet
2 participants
@edmundoa
Member

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.

Set Cache-Control on rest resources
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.

@edmundoa edmundoa added this to the 2.0.2 milestone May 17, 2016

@joschi

This comment has been minimized.

Contributor

joschi commented May 17, 2016

LGTM. 👍

@joschi joschi merged commit 20c32a6 into 2.0 May 17, 2016

4 checks passed

ci-server-integration Jenkins build graylog2-server-integration-pr 906 has succeeded
Details
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 added a commit that referenced this pull request May 17, 2016

Set Cache-Control on HTTP responses (#2246)
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

This comment has been minimized.

Member

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

This comment has been minimized.

Member

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