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
Copy file name to clipboardExpand all lines: docs/guide/ssr.md
+1-4Lines changed: 1 addition & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,6 @@
1
1
# Server Side Rendering (SSR)
2
2
3
-
<!-- NOTE: hide until it works -->
4
-
<!-- ::: tip
5
-
If you are using Nuxt.js, read the [Nuxt guide](/nuxt/getting-started.md) instead, most of the things are already configured for you.
6
-
::: -->
3
+
> Manually doing Server Side Rendering can get really complex, it is recommended to use Nuxt. Read the [Nuxt guide](/nuxt/getting-started.md), most of the things are already configured for you.
7
4
8
5
::: warning
9
6
SSR support is still experimental. Please report any issues you find.
Copy file name to clipboardExpand all lines: docs/nuxt/deployment.md
+71-2Lines changed: 71 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,12 @@
1
1
# Deployment
2
2
3
+
> This section is a work in progress.
4
+
3
5
It is recommended not to SSR every route in your application. Instead, you should only SSR or SSG (generate at build) the routes that are critical for SEO and performance. For example, you can SSG the homepage and the product pages, but not the cart page or profile pages.
4
6
5
-
You can achieve this by combining the [`prerender` option for nitro](https://nuxt.com/docs/getting-started/deployment#manual-pre-rendering):
7
+
You can achieve this by combining the [`prerender` option for nitro](https://nuxt.com/docs/getting-started/deployment#selective-pre-rendering):
6
8
7
-
```ts{4-6}
9
+
```ts
8
10
// nuxt.config.ts
9
11
defineNuxtConfig({
10
12
nitro: {
@@ -16,6 +18,25 @@ defineNuxtConfig({
16
18
})
17
19
```
18
20
21
+
and the [`routeRules` option](https://nuxt.com/docs/guide/concepts/rendering#hybrid-rendering) to enable Hybrid rendering:
22
+
23
+
```ts
24
+
// nuxt.config.ts
25
+
defineNuxtConfig({
26
+
routeRules: {
27
+
// Homepage pre-rendered at build time
28
+
'/': { prerender: true },
29
+
// Product page generated on-demand, revalidates in background
30
+
'/products/**': { swr: true },
31
+
// Blog post generated on-demand once until next deploy
32
+
'/blog/**': { isr: true },
33
+
// Admin dashboard renders only on client-side
34
+
'/admin/**': { ssr: false },
35
+
},
36
+
// ...
37
+
})
38
+
```
39
+
19
40
## Spark plan
20
41
21
42
The Spark plan is a free plan that enable most of firebase functions. With this plan, you want to **prerender your app and deploy it as a static site**. In order to do this, make sure **not to apply the Firebase preset** when bundling your app and to use the `generate` command:
@@ -30,6 +51,54 @@ You can then let your CI deploy your app to Firebase or do it manually:
30
51
firebase deploy
31
52
```
32
53
54
+
### Nitro Preset
55
+
56
+
To customize the Firebase functions configuration, it's recommended to create your own _nitro preset_ instead of using the `firebase` preset.
0 commit comments