-
Notifications
You must be signed in to change notification settings - Fork 5.5k
filter: Add HttpCache interface and helpers #9878
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # DO NOT EDIT. This file is generated by tools/proto_sync.py. | ||
|
|
||
| load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") | ||
|
|
||
| licenses(["notice"]) # Apache 2 | ||
|
|
||
| api_proto_package( | ||
| deps = [ | ||
| "//envoy/api/v2/route:pkg", | ||
| "//envoy/type/matcher:pkg", | ||
| "@com_github_cncf_udpa//udpa/annotations:pkg", | ||
| ], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package envoy.config.filter.http.cache.v2; | ||
|
|
||
| import "envoy/api/v2/route/route_components.proto"; | ||
| import "envoy/type/matcher/string.proto"; | ||
|
|
||
| import "google/protobuf/any.proto"; | ||
|
|
||
| import "udpa/annotations/migrate.proto"; | ||
| import "validate/validate.proto"; | ||
|
|
||
| option java_package = "io.envoyproxy.envoy.config.filter.http.cache.v2"; | ||
| option java_outer_classname = "CacheProto"; | ||
| option java_multiple_files = true; | ||
| option (udpa.annotations.file_migrate).move_to_package = "envoy.extensions.filters.http.cache.v3"; | ||
|
|
||
| // [#protodoc-title: HTTP Cache Filter] | ||
| // HTTP Cache Filter :ref:`overview <config_http_filters_cache>`. | ||
| // [#extension: envoy.filters.http.cache] | ||
|
|
||
| // [#next-free-field: 6] | ||
| message CacheConfig { | ||
| // [#not-implemented-hide:] | ||
| // Modifies cache key creation by restricting which parts of the URL are included. | ||
| message KeyCreatorParams { | ||
| // If true, exclude the URL scheme from the cache key. Set to true if your origins always | ||
| // produce the same response for http and https requests. | ||
| bool exclude_scheme = 1; | ||
|
|
||
| // If true, exclude the host from the cache key. Set to true if your origins' responses don't | ||
| // ever depend on host. | ||
| bool exclude_host = 2; | ||
|
|
||
| // If *query_parameters_included* is nonempty, only query parameters matched | ||
| // by one or more of its matchers are included in the cache key. Any other | ||
| // query params will not affect cache lookup. | ||
| repeated api.v2.route.QueryParameterMatcher query_parameters_included = 3; | ||
|
|
||
| // If *query_parameters_excluded* is nonempty, query parameters matched by one | ||
| // or more of its matchers are excluded from the cache key (even if also | ||
| // matched by *query_parameters_included*), and will not affect cache lookup. | ||
| repeated api.v2.route.QueryParameterMatcher query_parameters_excluded = 4; | ||
| } | ||
|
|
||
| // Config specific to the cache storage implementation. | ||
| google.protobuf.Any typed_config = 1; | ||
|
|
||
| // Name of cache implementation to use, as specified in the intended HttpCacheFactory | ||
| // implementation. Cache names should use reverse DNS format, though this is not enforced. | ||
| string name = 2; | ||
|
|
||
| // [#not-implemented-hide:] | ||
| // <TODO(toddmgreer) implement *vary* headers> | ||
| // | ||
| // List of allowed *Vary* headers. | ||
| // | ||
| // The *vary* response header holds a list of header names that affect the | ||
| // contents of a response, as described by | ||
| // https://httpwg.org/specs/rfc7234.html#caching.negotiated.responses. | ||
| // | ||
| // During insertion, *allowed_vary_headers* acts as a whitelist: if a | ||
| // response's *vary* header mentions any header names that aren't in | ||
| // *allowed_vary_headers*, that response will not be cached. | ||
| // | ||
| // During lookup, *allowed_vary_headers* controls what request headers will be | ||
| // sent to the cache storage implementation. | ||
| repeated type.matcher.StringMatcher allowed_vary_headers = 3; | ||
|
|
||
| // [#not-implemented-hide:] | ||
| // <TODO(toddmgreer) implement key customization> | ||
| // | ||
| // Modifies cache key creation by restricting which parts of the URL are included. | ||
| KeyCreatorParams key_creator_params = 4; | ||
|
|
||
| // [#not-implemented-hide:] | ||
| // <TODO(toddmgreer) implement size limit> | ||
| // | ||
| // Max body size the cache filter will insert into a cache. 0 means unlimited (though the cache | ||
| // storage implementation may have its own limit beyond which it will reject insertions). | ||
| uint32 max_body_bytes = 5; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # DO NOT EDIT. This file is generated by tools/proto_sync.py. | ||
|
|
||
| load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") | ||
|
|
||
| licenses(["notice"]) # Apache 2 | ||
|
|
||
| api_proto_package( | ||
| deps = [ | ||
| "//envoy/config/filter/http/cache/v2:pkg", | ||
| "//envoy/config/route/v3:pkg", | ||
| "//envoy/type/matcher/v3:pkg", | ||
| "@com_github_cncf_udpa//udpa/annotations:pkg", | ||
| ], | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| syntax = "proto3"; | ||
|
|
||
| package envoy.extensions.filters.http.cache.v3; | ||
|
|
||
| import "envoy/config/route/v3/route_components.proto"; | ||
| import "envoy/type/matcher/v3/string.proto"; | ||
|
|
||
| import "google/protobuf/any.proto"; | ||
|
|
||
| import "udpa/annotations/versioning.proto"; | ||
|
|
||
| import "validate/validate.proto"; | ||
|
|
||
| option java_package = "io.envoyproxy.envoy.extensions.filters.http.cache.v3"; | ||
| option java_outer_classname = "CacheProto"; | ||
| option java_multiple_files = true; | ||
|
|
||
| // [#protodoc-title: HTTP Cache Filter] | ||
| // HTTP Cache Filter :ref:`overview <config_http_filters_cache>`. | ||
| // [#extension: envoy.filters.http.cache] | ||
|
|
||
| // [#next-free-field: 6] | ||
| message CacheConfig { | ||
| option (udpa.annotations.versioning).previous_message_type = | ||
| "envoy.config.filter.http.cache.v2.CacheConfig"; | ||
|
|
||
| // [#not-implemented-hide:] | ||
| // Modifies cache key creation by restricting which parts of the URL are included. | ||
| message KeyCreatorParams { | ||
| option (udpa.annotations.versioning).previous_message_type = | ||
| "envoy.config.filter.http.cache.v2.CacheConfig.KeyCreatorParams"; | ||
|
|
||
| // If true, exclude the URL scheme from the cache key. Set to true if your origins always | ||
| // produce the same response for http and https requests. | ||
| bool exclude_scheme = 1; | ||
|
|
||
| // If true, exclude the host from the cache key. Set to true if your origins' responses don't | ||
| // ever depend on host. | ||
| bool exclude_host = 2; | ||
|
|
||
| // If *query_parameters_included* is nonempty, only query parameters matched | ||
| // by one or more of its matchers are included in the cache key. Any other | ||
| // query params will not affect cache lookup. | ||
| repeated config.route.v3.QueryParameterMatcher query_parameters_included = 3; | ||
|
|
||
| // If *query_parameters_excluded* is nonempty, query parameters matched by one | ||
| // or more of its matchers are excluded from the cache key (even if also | ||
| // matched by *query_parameters_included*), and will not affect cache lookup. | ||
| repeated config.route.v3.QueryParameterMatcher query_parameters_excluded = 4; | ||
| } | ||
|
|
||
| // Config specific to the cache storage implementation. | ||
| google.protobuf.Any typed_config = 1; | ||
|
|
||
| // Name of cache implementation to use, as specified in the intended HttpCacheFactory | ||
| // implementation. Cache names should use reverse DNS format, though this is not enforced. | ||
| string name = 2; | ||
|
|
||
| // [#not-implemented-hide:] | ||
| // <TODO(toddmgreer) implement *vary* headers> | ||
| // | ||
| // List of allowed *Vary* headers. | ||
| // | ||
| // The *vary* response header holds a list of header names that affect the | ||
| // contents of a response, as described by | ||
| // https://httpwg.org/specs/rfc7234.html#caching.negotiated.responses. | ||
| // | ||
| // During insertion, *allowed_vary_headers* acts as a whitelist: if a | ||
| // response's *vary* header mentions any header names that aren't in | ||
| // *allowed_vary_headers*, that response will not be cached. | ||
| // | ||
| // During lookup, *allowed_vary_headers* controls what request headers will be | ||
| // sent to the cache storage implementation. | ||
| repeated type.matcher.v3.StringMatcher allowed_vary_headers = 3; | ||
|
|
||
| // [#not-implemented-hide:] | ||
| // <TODO(toddmgreer) implement key customization> | ||
| // | ||
| // Modifies cache key creation by restricting which parts of the URL are included. | ||
| KeyCreatorParams key_creator_params = 4; | ||
|
|
||
| // [#not-implemented-hide:] | ||
| // <TODO(toddmgreer) implement size limit> | ||
| // | ||
| // Max body size the cache filter will insert into a cache. 0 means unlimited (though the cache | ||
| // storage implementation may have its own limit beyond which it will reject insertions). | ||
| uint32 max_body_bytes = 5; | ||
| } |
13 changes: 13 additions & 0 deletions
13
generated_api_shadow/envoy/config/filter/http/cache/v2/BUILD
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
82 changes: 82 additions & 0 deletions
82
generated_api_shadow/envoy/config/filter/http/cache/v2/cache.proto
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
generated_api_shadow/envoy/extensions/filters/http/cache/v3/BUILD
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.