-
Notifications
You must be signed in to change notification settings - Fork 30
Allow users to specify that caddy-cache should ONLY cache paths from match_path #26
Comments
Maybe I should update the documentation, but the idea is to always respect the headers. The "basic usage" (if you specify a path in the config) is just a "hint". For example: if you add I hope this clarifies how it works. |
That makes sense, thanks for the clarification. Maybe the documentation could make this clearer if it were structured along the lines of:
|
I ran into this issue as well. In combo with issue #28, it resulted in the unexpected behavior of serving up empty 304 responses 😮. I think it's confusing because the label syntax in many other Caddy plugins is activated based on the path. For example: Confusion results because the label syntax in the |
@csytan The idea was to be able to use it without configure anything and use cache headers. I'm sorry if that's not how it looks. I wanted to offer both ways to enable it: header based rules and config based rules (becase maybe you don't control headers or what a simpler way). What would it be the ideal caddyfile for you having that in mind? (#28 was already solved) |
@nicolasazrak I think a path based approach would be easier to understand. For example:
For backwards compatibility, if no is path specified, then cache every path:
P.S. Thank you for working on this project. Looking forward to trying the fix for #28 👍 |
Currently, it appears that even if I use the "advanced usage" approach and specify a particular path to be cached, other paths can automatically be cached as well.
In my case, I would like to instruct caddy-cache only to cache the
/api
path, and leave everything else out of the cache, regardless of what headers it may include. However, even if I specifymatch_path /api
in thecache
directive of my Caddyfile, I see other files from outside that path appearing in the cache.I'm not sure if this behavior is by design or not. But the documentation seems to suggest that only the "basic usage" approach should result in this automatic behavior, and the presence of any "advanced usage" should restrict caching to just the path the user specified.
The text was updated successfully, but these errors were encountered: