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

Make cache lifetime for static files configurable #7

Open
robertlemke opened this issue May 4, 2022 · 1 comment · Fixed by #8
Open

Make cache lifetime for static files configurable #7

robertlemke opened this issue May 4, 2022 · 1 comment · Fixed by #8
Assignees
Labels
customer input feature suggestion or bug report collected from existing or potential customers (source) enhancement enhances an existing feature or functionality (improvements)

Comments

@robertlemke
Copy link
Member

The cache lifetime sent in an HTTP response as the "expires" header should be configurable via an environment variable.

@robertlemke robertlemke added customer input feature suggestion or bug report collected from existing or potential customers (source) enhancement enhances an existing feature or functionality (improvements) labels May 4, 2022
@robertlemke robertlemke self-assigned this May 4, 2022
robertlemke added a commit that referenced this issue May 4, 2022
This change introduces a new environment variable
NGINX_STATIC_FILES_LIFETIME which allows for configuration of the
cache lifetime controlled through the HTTP response's "expires"
header. The default expiration time is now 30 days.

Apart from Flow's static resources, additional files in the top
directory are now covered (favicon.ico, apple-touch-icon.* etc).

Resolves #7
@robertlemke robertlemke linked a pull request May 4, 2022 that will close this issue
@robertlemke robertlemke reopened this May 5, 2022
@robertlemke
Copy link
Member Author

The cache lifetime I set (30d) is too short – Google Lighthouse wants at least half a year.

And we will need changes in the Google Cloud Storage plugin in order to achieve proper cache lifetimes for persistent resources (see flownative/flow-google-cloudstorage#32).

robertlemke added a commit that referenced this issue May 5, 2022
The "expires" statement does not seem to have an effect – the lifetime
provided by Google always won. However, providing Cache-Control might
work and solve as a hotfix for flownative/flow-google-cloudstorage#32

#7
robertlemke added a commit that referenced this issue May 5, 2022
Google does not consider a lifetime of 30 days as long enough, but
6 months should work fine.

#7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
customer input feature suggestion or bug report collected from existing or potential customers (source) enhancement enhances an existing feature or functionality (improvements)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants