Add ability to disable caching per-location
Bug #1999704 reported by
James Simpson
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Content Cache Charm |
Fix Released
|
High
|
Haw Loeung |
Bug Description
In some circumstances it's desirable to not serve cached responses, nor cache them in the first place.
For example, we may want /api to always return live results from the actual backend.
Attempting to configure "proxy_cache off;" via "extra-config" results in an nginx configuration error due to duplicate configuration keys:
nginx: [emerg] "proxy_cache" directive is duplicate
We should add an option in the site config that disables the "proxy_cache" configuration and replaces it with "proxy_cache off;".
Related branches
~hloeung/content-cache-charm:nginx-config-proxy-cache
- Paul Collins: Approve
- Canonical IS Reviewers: Pending requested
-
Diff: 59 lines (+7/-3)4 files modifiedlib/utils.py (+0/-1)
templates/nginx_cfg.tmpl (+4/-0)
tests/unit/files/config_test_config.txt (+2/-1)
tests/unit/files/nginx_config_rendered_test_output-site11.local.txt (+1/-1)
Changed in content-cache-charm: | |
status: | New → Triaged |
assignee: | nobody → Haw Loeung (hloeung) |
importance: | Undecided → High |
status: | Triaged → In Progress |
Changed in content-cache-charm: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
You can now do this as follows with the latest commit:
| site11.local:
| locations:
| /:
| backends: *BACKENDS
| backend-options:
| - forwardfor except 127.0.0.1 192.168.1.1
| - forceclose
| cache: off