Skip to content

Commit

Permalink
feat: Allow exposing Cache-Tags header when Varnish serve API and N…
Browse files Browse the repository at this point in the history
…uxt responses
  • Loading branch information
ambroisemaupate committed May 28, 2024
1 parent 95213b6 commit 0833570
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions config/packages/nelmio_cors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ nelmio_cors:
origin_regex: true
allow_origin: ['%env(CORS_ALLOW_ORIGIN)%']
allow_methods: ['GET', 'OPTIONS', 'POST', 'PUT']
allow_headers: ['Content-Type', 'Authorization', 'Www-Authenticate', 'x-g-recaptcha-response']
expose_headers: ['Link', 'Www-Authenticate']
allow_headers: ['Content-Type', 'Authorization', 'Www-Authenticate', 'x-g-recaptcha-response', 'Cache-Tags']
expose_headers: ['Link', 'Www-Authenticate', 'Cache-Tags']
max_age: 3600
paths:
'^/': ~
Expand Down
4 changes: 2 additions & 2 deletions docker/varnish/default.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ sub vcl_deliver {
#
# You can do accounting or modifying the final object here.

# Remove cache-tags, unless you want Cloudflare or other to see them
# Remove cache-tags, unless you want Cloudflare or Nuxt to see them (to use cache tags on Nuxt responses)
# Make sure to allow CORS on Cache-Tags header if you want to use it on Nuxt.
unset resp.http.X-Cache-Tags;
# Comment the following line to send the "Cache-Tags" header to the client (e.g. to use CloudFlare cache tags)
unset resp.http.Cache-Tags;
}

0 comments on commit 0833570

Please sign in to comment.