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

Support configuring cache-control for index.html when using BP_WEB_SERVER #461

Closed
uqix opened this issue Oct 25, 2022 · 3 comments
Closed

Comments

@uqix
Copy link

uqix commented Oct 25, 2022

Before using this buildpack, we use the nginx configuration below to disable cache for index.html:

        # https://stackoverflow.com/a/41635866
        location / {
          try_files $uri $uri/ /index.html;
          gzip_static on;
        }
        location = /index.html {
          add_header cache-control {{ .Values.indexHtmlCacheControl | squote }};
          add_header last-modified '';
          etag off;
        }

it seems this buildpack doesn't provide such option.

Describe the Enhancement

Possible Solution

Motivation

Explicit cache-control for index.html page is more controllable.

@arjun024
Copy link
Member

BP_WEB_SERVER is designed for an application to serve the most basic static file applications. See the RFC https://github.com/paketo-buildpacks/rfcs/blob/main/text/web-servers/0004-zero-config.md#detailed-explanation

For your use case, I would suggest you to provide your own nginx.conf.
See example https://github.com/paketo-buildpacks/samples/tree/main/web-servers/nginx-sample

@uqix
Copy link
Author

uqix commented Oct 25, 2022

Thanks, just realized the root cause is the normalized image date, will try to fix that by SOURCE_DATE_EPOCH as described in https://github.com/buildpacks/rfcs/blob/main/text/0103-source-date-epoch.md

@uqix uqix closed this as completed Oct 25, 2022
@uqix
Copy link
Author

uqix commented Oct 27, 2022

Same problem as #447

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