Skip to content

Reset Pragma header when caching - #840

Closed
felixbarny wants to merge 1 commit into
spring-projects:masterfrom
felixbarny:patch-1
Closed

felixbarny wants to merge 1 commit into
spring-projects:masterfrom
felixbarny:patch-1

Conversation

@felixbarny

Copy link
Copy Markdown
Contributor

Spring Security by default sets a Pragma: no-cache header (see CacheControlHeadersWriter). Even if explicitly calling WebContentGenerator#applyCacheSeconds that header is still present, preventing the browser from caching the resource. So cacheForSeconds should remove the Pragma header if it has been set.

Spring Security by default sets a `Pragma: no-cache` header. Even if explicitly calling WebContentGenerator#applyCacheSeconds that header is still present, preventing the browser from caching the resource. So cacheForSeconds should remove the Pragma header if it has been set.
@bclozel

bclozel commented Jul 21, 2015

Copy link
Copy Markdown
Member

This has been resolved with 09e3fc4 in SPR-13252.
Thanks!

By the way did you sign our CLA?

@bclozel bclozel closed this Jul 21, 2015
@felixbarny

Copy link
Copy Markdown
Contributor Author

I have signed and agree to the terms of the SpringSource Individual Contributor License Agreement.

@bclozel

bclozel commented Jul 21, 2015

Copy link
Copy Markdown
Member

Thanks @felixbarny
One more question - did you discover this as a regression when testing the latest RCs with an existing application? Or did you use those HTTP caching features for the first time in an app and found this bug?

(just trying to prepare for a smooth upgrade for all Spring developers...)

@felixbarny

Copy link
Copy Markdown
Contributor Author

I've discovered this after upgrading from spring-security 3 to 4 as with version 4, the Pragma header is set by default.

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