Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Paul Valladares <85648028+dreyfus92@users.noreply.github.com>
  • Loading branch information
lilnasy and dreyfus92 committed Aug 30, 2023
1 parent aac05af commit e94fe49
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ Netlify supports caching via two methods: `Cache-Control` headers, which works w
#### On-demand Builders
On-demand Builders are serverless functions used to generate web content as needed that’s automatically cached on Netlify’s Edge CDN. They enable you to build
To enable them, set the `builders` option to `true` in your config file.
```ts title="stro.config.js" ins={6}
```ts title="astro.config.js" ins={6}

import { defineConfig } from 'astro/config'
import netlify from '@astrojs/netlify/functions'

Expand All @@ -143,7 +144,8 @@ export default defineConfig({
})
```
By default, pages for your site will be built when a user visits them for the first time and then cached at the edge for subsequent visits. To set a revalidation time, call the `runtime.setBuildersTtl(ttl)` local with the duration (in seconds). For example, to set a revalidation time of 60 seconds:
```ts title="src/pages/index.astro"
```astro title="src/pages/index.astro"
---
Astro.locals.runtime.setBuildersTtl(60)
---
Expand Down

0 comments on commit e94fe49

Please sign in to comment.