apache / apache/apisix

Set proxy_ignore_headers to proxy-cache config block

Open
#11,573 3 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Lua
Stars
17.1k
Forks
2.9k
Avg merge
3d 16h
Merged PRs (30d)
63

Description

### Description

We'd like to be able to set the proxy_ignore_headers in the [proxy-cache config block](https://github.com/apache/apisix/blob/master/apisix/cli/ngx_tpl.lua#L773)

Use case: We want to cache responses no matter what's in the Cache-Control header so we need to set
`proxy_ignore_headers Cache-Control;`

Ideally this should be per route, as we configure the proxy-cache plugin per route. Our deployment relies in K8S APISIXRoute resources for configuration so I assume this will affect some other layers apart from the LUA tpl.

We have tested this in a live system by tweaking the nxg_tpl.lua file and reloading the config. After reloading the config the cache started HIT'ing just fine, whole before it was always MISS'ing

Contributor guide

Open the contributing guide

Research direction

Start at apisix/cli/ngx_tpl.lua around line 773 and trace how the proxy-cache plugin and Kubernetes APISIXRoute resources produce configuration. Check the existing reload behavior described in the issue, then determine the configuration path needed for per-route proxy_ignore_headers. Done means Cache-Control responses can be cached for the configured route and produce cache HITs after reload.

Written by the indexing model from the issue text.

Assessment

Tech stack
kubernetes, lua, nginx
Domain
api, backend, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.