Skip to content

Use same pragma settings in WebContentGenerator as in AbstractView [SPR-9543] #14177

Closed

Description

@spring-projects-issues

Scott Carlson opened SPR-9543 and commented

I attempted to use mvc:resource/ to map to some application PDFs. However, IE8 fails with the settings from preventCaching(). The fix is already used in AbstractView.generateDownloadContent(). It this was consistent, it would be a benefit.

I was able to get around it, by subclassing ResourceHttpRequestHandler, and wiring up my own beans.


Affects: 3.1.1

This issue is a sub-task of #16413

Issue Links:

Activity

  1. spring-projects-issues commented on Sep 10, 2012

    @spring-projects-issues
    CollaboratorAuthor

    Rossen Stoyanchev commented

    I'm not sure what you mean by the "settings from preventCaching()".

  2. spring-projects-issues commented on Mar 23, 2015

    @spring-projects-issues
    CollaboratorAuthor

    Brian Clozel commented

    ResourceHttpRequestHandler can now be configured with flexible strategies for "Cache-Control" HTTP response headers.

    When serving generated resources, that should not be cached by public caches, one can use the following:

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/resources/**")
                    .addResourceLocations("classpath:/resources/")
                    .setCacheControl(CacheControl.noStore().cachePrivate());

    This will write a "Cache-Control: no-store, private" header in HTTP responses.

    See #16413 for more details.

  3. added
    in: web
    type: task
    on Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

in: webtype: task

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions