Proxy-Cache unexpected behavior with wildcards in path


#1

I’m working on adding the proxy-cache plugin to routes, and am seeing some unexpected behavior:

a route with a path like this caches fine (with the api_key param explicitly not included)
v4/word.json/.*?api_key=key

a route with a path like this caches fine (with date included as a param, api_key explicitly not included):
v4/wordOfTheDay?date=yyyy-mm-dd&api_key=key

a route like this shows the cache plugin as active when I check routes/routeid/plugins, but returns no cache headers when called (not a Bypass, just no cache headers at all)
v4/word.json/.*/hyphenation?api_key=key

Is there an issue with caching routes that include non-terminal wildcards, and if so, are there any workarounds? I’ve tried including ‘hyphenation’ in the params config, but that doesn’t make a difference (still no cache headers in response).

Any suggestions gratefully received!

Erin


#2

Hi Erin,

There’s no limitation in defining proxy-cache plugins on routes with regex path definitions. It would be helpful to see the exact definitions of the Route objects in question to better ascertain exactly what’s going on.


#3

Thanks! here’s the route object:

   {
  "created_at": 1537567934,
  "strip_path": false,
  "hosts": null,
  "preserve_host": false,
  "regex_priority": 0,
  "updated_at": 1537567934,
  "paths": [
    "/v4/word.json/.*/hyphenation"
  ],
  "service": {
    "id": "4bf72854-dd37-439b-aa06-16ea67bc17be"
  },
  "methods": [
    "GET"
  ],
  "protocols": [
    "http",
    "https"
  ],
  "id": "5037ac15-f5ee-4f48-883f-fdec3cc7e5ff"
}

#4

Hi, just pinging on this!