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

Provide configurable Cache-Control header for static files #53

Closed
jeevatkm opened this issue Jun 1, 2017 · 1 comment
Closed

Provide configurable Cache-Control header for static files #53

jeevatkm opened this issue Jun 1, 2017 · 1 comment
Assignees
Labels
aah Framework scope enhancement

Comments

@jeevatkm
Copy link
Member

jeevatkm commented Jun 1, 2017

Goal is achieve configurable Cache-Control header for static files.

  • Default cache header
  • Mime type wise Cache-Control configuration
@jeevatkm jeevatkm added aah Framework scope enhancement labels Jun 1, 2017
@jeevatkm jeevatkm self-assigned this Jun 1, 2017
@jeevatkm jeevatkm added this to the v0.6 Milestone milestone Jun 1, 2017
@jeevatkm
Copy link
Member Author

jeevatkm commented Jun 1, 2017

static file cache configuration in aah.conf:

cache {
  static {
    # Default `Cache-Control` for all static files,
    # if specific mime type is not defined.
    default_cache_control = "public, max-age=31536000"

    # (Optional) Define by mime types, if mime is not present then default is applied.
    # Config is very flexible to define by mime type.
    #
    # Create a unique name and provide `mime` with comma separated value
    # and `cache_control`.
    mime_types {
       css_js {
         mime = "text/css, application/javascript"
         cache_control = "public, max-age=604800, must-revalidate, proxy-revalidate"
       }
    
       images {
         mime = "image/jpeg, image/png, image/gif, image/svg+xml, image/x-icon"
         cache_control = "public, max-age=2628000, must-revalidate, proxy-revalidate"
       }
    }
  }
}

to be released in v0.6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aah Framework scope enhancement
Projects
None yet
Development

No branches or pull requests

1 participant