Skip to content
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

Caching lambda proxy requests #67

Closed
cbarlow1993 opened this issue Mar 22, 2020 · 1 comment
Closed

Caching lambda proxy requests #67

cbarlow1993 opened this issue Mar 22, 2020 · 1 comment

Comments

@cbarlow1993
Copy link

I have a lambda function which proxy's several requests under a /v1/pages/{proxy+} path.

Is it possible to set individual cache keys for each page underneath it?

Path examples.

/v1/pages/home
/v1/pages/categories
/v1/pages/categories/:categoryAlias

    handler: index.main
    events:
      - http:
          path: '/v1/pages/{proxy+}'
          method: any
          cors: true
          caching:
            enabled: true
@DianaIonita
Copy link
Owner

Hi @cbarlow1993,

You should be able to get per-page caching by specify the proxy as a cache key parameter like so:

    handler: index.main
    events:
      - http:
          path: '/v1/pages/{proxy+}'
          method: any
          cors: true
          caching:
            enabled: true
		    cacheKeyParameters:
              - name: request.path.proxy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants