Skip to content

Add support for versioning resources [SPR-7402] #12060

Closed

Description

@spring-projects-issues

Jeremy Grelle opened SPR-7402 and commented

As a user, I would like support for resource versioning so it is possible to get the benefits of caching with the ability to refresh changes.

Implementation option #1


Automatic versioning with file timestamps e.g. /resources/main.123456789.css

Implementation option #2


Manual versioning with version number e.g. /resources/version-1.0.0/main.css

Both options would require ResourceHttpRequestHandler to strip out the version number from the request URI to obtain the "real" resource path. In addition, a view helper function or tag would be needed to generate versioned URLs e.g. <spring:resource name="main.css"/> might generate http://localhost:8080/app/resources/main.123456789.css.

Resources:
http://stackoverflow.com/questions/118884/what-is-an-elegant-way-to-force-browsers-to-reload-cached-css-js-files
http://particletree.com/notebook/automatically-version-your-css-and-javascript-files/


Affects: 3.0.2

This issue is a sub-task of #12058

Activity

  1. added
    status: duplicate
    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

No one assigned

    Labels

    in: webstatus: duplicatetype: task

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions