Closed samouri closed 3 years ago
This is already supported via new AmpOptimizer({ cache: false })
. You can also provide an in memory alternative: new AmpOptimizer({ cache: new Map() })
.
Awesome! Lets document in https://github.com/ampproject/amp-toolbox/tree/master/packages/optimizer#options
summary
There are environments in which one would want to run the AMP Optimizer that do not have access to a filesystem. For example, any function as a service (FAAS) like GCP Cloud Functions or Cloudflare Workers.
For this case, it would be better to disable the fs cache entirely so that errors don't pollute the logs. Ideally it could be configured via the options bag on init, i.e.
new AmpOptimizer({ fsCache: false })