Read-only mode enables security and performance similar to static sites

ServerlessWP now supports a read-only mode that blocks http request methods associated with dynamic WordPress features while at the same time enabling CDN caching on all pages.

This results in faster page loads for cached content and less surface area for security vectors. It prevents site editing while enabled though.

Setting an environment variable named SERVERLESSWP_READ_ONLY_MODE to 1 or true in your project’s Vercel or Netlify settings and then redeploying the project will enable this. Switch it to 0 or false and redeploy to be able to edit the site again.

To set the duration of the cache control max-age in seconds, use the SERVERLESSWP_READ_ONLY_CACHE_MAX_AGE environment variable. It defaults to 86400 seconds (1 day).

When combined with SQLite + S3, ServerlessWP does not make any database updates and uses cached versions of the database. This results in even less costs for this data layer approach.

Pages will be cached only if a user with no cookies for the website requests the content. This is done to avoid caching potentially private content.