You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to customize allowedHttpMethods and cachedHttpMethods properties of default caching behaviour.
Reason is I have people running a lot of POST requests on my frontpage bypassing any caching and causing a bill increase because of data transfer and lambda executions.
Is there any reason why are these options set the way they are and cannot be customized?
Expected behavior
Currently hardcoded values should rather be defaults that can be overwritten.
Versions
OS/Environment: Any
@sls-next/serverless-component version: 3.7.0
Next.js version: 11.1.2
Additional context
Checklist
You have reviewed the README and FAQs, which answers several common questions.
You have reviewed our DEBUGGING wiki and have tried your best to include complete information and reproduction steps (including your configuration) as is possible. As there is only one maintainer (who maintains this in his free time) and thus very limited resources, if you have time, please try to debug the issue a bit yourself if possible.
You have first tried using the most recent latest or alpha@sls-next/serverless-componentrelease version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the old serverless-next.js component and the serverless-next.js plugin are deprecated and no longer maintained.
The text was updated successfully, but these errors were encountered:
Issue Summary
I'm trying to customize
allowedHttpMethods
andcachedHttpMethods
properties of default caching behaviour.Reason is I have people running a lot of POST requests on my frontpage bypassing any caching and causing a bill increase because of data transfer and lambda executions.
I'm following docs and setting:
Actual behavior
Neither option works. No matter what value I pass the end result in the generated template in
.serverless
directory is always:It's because both values are hardcoded and ignore any attempt of customization.
allowedHttpMethods
is hardcoded here:serverless-next.js/packages/serverless-components/nextjs-component/src/component.ts
Lines 929 to 938 in ca7f7f7
cachedHttpMethods
is hardcoded here:serverless-next.js/packages/serverless-components/aws-cloudfront/src/getDefaultCacheBehavior.ts
Lines 46 to 49 in 04fec27
Is there any reason why are these options set the way they are and cannot be customized?
Expected behavior
Currently hardcoded values should rather be defaults that can be overwritten.
Versions
Additional context
Checklist
latest
oralpha
@sls-next/serverless-component
release version, which may have already fixed your issue or implemented the feature you are trying to use. Note that the oldserverless-next.js
component and theserverless-next.js
plugin are deprecated and no longer maintained.The text was updated successfully, but these errors were encountered: