@interlace/serverless
API Gateway Caching

Installation

Install @interlace/serverless-api-gateway-caching and verify it loads.

Install

npm install --save-dev @interlace/serverless-api-gateway-caching
pnpm add -D @interlace/serverless-api-gateway-caching
yarn add -D @interlace/serverless-api-gateway-caching
bun add -d @interlace/serverless-api-gateway-caching

Wire into the project

serverless.yml
plugins:
  - '@interlace/serverless-api-gateway-caching'

custom:
  interlaceCaching:
    enabled: true
    clusterSize: '0.5'
    ttlInSeconds: 300
serverless.ts
const serverlessConfiguration = {
  plugins: ['@interlace/serverless-api-gateway-caching'],
  custom: {
    interlaceCaching: {
      enabled: true,
      clusterSize: '0.5',
      ttlInSeconds: 300,
    },
  },
};
serverless.js
module.exports = {
  plugins: ['@interlace/serverless-api-gateway-caching'],
  custom: {
    interlaceCaching: {
      enabled: true,
      clusterSize: '0.5',
      ttlInSeconds: 300,
    },
  },
};
serverless.json
{
  "plugins": ["@interlace/serverless-api-gateway-caching"],
  "custom": {
    "interlaceCaching": {
      "enabled": true,
      "clusterSize": "0.5",
      "ttlInSeconds": 300
    }
  }
}

Smoke test

The dry-run command verifies the plugin registered and your config parses, without touching AWS:

sls caching preview

Expected output: a Caching plan block listing each http-event endpoint and the patch operations a deploy would apply.

Next

On this page