Add ability to disable caching per-location

Bug #1999704 reported by James Simpson
8
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

Haw Loeung (hloeung)
Changed in content-cache-charm:
status: New → Triaged
assignee: nobody → Haw Loeung (hloeung)
importance: Undecided → High
status: Triaged → In Progress
Revision history for this message
Haw Loeung (hloeung) wrote :

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

Changed in content-cache-charm:
status: In Progress → Fix Committed
Haw Loeung (hloeung)
Changed in content-cache-charm:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.