Comments (3)
@tobiasehlert just tested locally. You are right the Age header is not being returned.
I think the schema definition may be the problem. The header does not match the configuration header value.
I will try to submit a PR today with a possible fix so the Kong team can review it ASAP.
from kong.
Hey @tobiasehlert!
Looking at the documentation for proxy-cache plugin you are missing some configuration parameters on the plugin. It seems that if you want the response to have the Age header you need to enable the following configuration:
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: my-cache-1min
namespace: my-api-v4
config:
cache_ttl: 60
content_type:
- text/plain
- application/json
- application/json; charset=utf-8
request_method:
- GET
- HEAD
response_code:
- 200
ignore_uri_case: true
strategy: memory
reponse_headers:
age: true
plugin: proxy-cache
Link to the plugin documentation: https://docs.konghq.com/hub/kong-inc/proxy-cache/
Hope this helps,
Joel
from kong.
hi @joelact and thanks for your reply, but the issue doesn't lie in that.
When looking in the configuration of the plugin it says that the response_headers
section is required, but it has the three components set to true
already. So you actually don't need to specify all parameters since it should default to those default parameters when not being specified, except for one.. the config.strategy
!
You could actually create the KongPlugin resource by only doing this:
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: my-cache-1min
namespace: my-api-v4
config:
strategy: memory
plugin: proxy-cache
So yeah.. "required field" flag in the docs doesn't really apply to the KongPlugin part, since the admission webhook (kongplugins.validation.ingress-controller.konghq.com) doesn't actually validate those. Another parameter would be the config.cache_control
that is required but has a default and in their own docs (basic example) don't include that either.
But this is not the issue in this case.. it's that the config.response_headers.age
parameter is not respected.
Regards,
Tobias
from kong.
Related Issues (20)
- custom proxy_access_log still not working in 3.4.* HOT 3
- Kong prometheus plugin does not record 404 response codes from proxy HOT 2
- Timeout when running migrations from 3.5 to 3.6 leading to corrupted data (migration ran twice) HOT 3
- Admin API address in "New Connnection" form only support IP, not DNS. HOT 3
- Upsert target is not an upsert HOT 4
- failed to set X-Kong-Upstream-Status header while sending to client HOT 2
- [PostgreSQL error] failed to retrieve PostgreSQL server_version_num: connection refused HOT 2
- DNS resolution failed: dns server error: 3 name error HOT 14
- Optional capture groups are broken with the request-transformer plugin and traditional_compatible router HOT 4
- Error in logs: failed to run timer HOT 2
- Database migration failed while using helm chart HOT 2
- JWT Plugin bypasses validation process occasionally on frequent requests HOT 3
- TLS SNI Route not work HOT 6
- Kong info, notice, inspect logs are all getting logged as error in GCP(google cloud platform) HOT 1
- Cannot use kong.db
- http-log plugin: Host header not including port HOT 3
- Every time request localhost:8001/metrics, kong-cp-kong-pod will prompt a license-related error HOT 1
- Dataplane not getting information from the ControlPlane in Hybrid mode HOT 2
- go plugin error, worker-events: event callback failed; source=plugin_server, event=reset_instance HOT 1
- Error: attempt to index local 'ssl' (a nil value) for Kong >= 3.6.0 when KONG_PG_SSL=on HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kong.