Cache Key and Redirect

Hi,

I would like to request some features

  1. Follow redirect: this option should be available through Netlify config files _redirect and netlify.toml. When enabled, it’ll follow the redirect response to get the lest response from ending url which is not the redirect

  2. Ignore query string CDN cache: this option should be available through Netlify config files _redirect and netlify.toml. When enabled, it’ll cache the response based only on the url domain + url path while ignoring the query string as cache key. So any requests to the same path with any query string will always return the same response. Or this option can be something more flexible by just setting the cacheKey directly. E.g cacheKey: ${req.host}${req.path}

  3. Custom cache key in Netlify function and Edge function: this is similar to number 2. The cacheKey can be any string given in the function. Any request with the same cacheKey will return the same response.

Hi @Vichet97 ,

  1. this is what our reverse proxying feature does already :slight_smile: . Check out the docs: Rewrites and proxies | Netlify Docs . You can use this either on a local path (/old /new 200 or if it’s a remove service, /old https://newserver/path 200)
  2. our query param caching is not modifiable by you, intentionally - it’s involved with how we cache and so this is not something we’ll implement. Could you talk more about the problem you are trying to solve, rather than your suggestion to solve it? Perhaps we have a way , but we’d never know from you showing up with a supposed answer, rather than a question about how to accomplish a goal :slight_smile:
  3. just add that key to the path: /.netlify/functions/funcname/key - all set, no need to build anything new :slight_smile: