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

Add Caching Headers #52

Open
bbatsche opened this issue Jan 31, 2019 · 1 comment
Open

Add Caching Headers #52

bbatsche opened this issue Jan 31, 2019 · 1 comment

Comments

@bbatsche
Copy link
Member

All requests going through UPWARD PHP, including those for static files, include Cache-Control: no-store, no-cache, must-revalidate. There needs to be some better handling of response caching, especially for File & Directory Resolvers

  • Determine what the appropriate caching policy should be
    • What should the cache lifetime be?
    • Should we include an ETag, or are those passé?
    • In what cases should a cache header be included or not?
  • Add the appropriate cache headers
  • What options should there be for disabling or clearing these headers (eg for development vs production)?
@manishparanjape
Copy link

manishparanjape commented Oct 2, 2019

We can define cache headers in upward.yml file.

Example
bundles:
  directory:
    inline: './dist'
  headers:
    inline:
      cache-control:
        inline: max-age=86400

in Resolver Class we can query and set these headers.

$headers    = $this->getIterator()->get('headers', $definition);
$response->getHeaders()->addHeaders($headers);

Will try this and update here.

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

No branches or pull requests

2 participants