Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions docs/capabilities/devvit-web/devvit_web_overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,28 @@ As with most experimental features, there are some caveats.
| Single request and single response handling only | Streaming or chunked responses and websockets are not supported. Long-polling is supported if it's under the max request time. |
| No external requests from your client | You can't have any external requests other than the app's webview domain. All backend responses are locked down to the webview domain via CSP. (Your backend can make external fetch requests though.) |
| localStorage clears on app updates | The iframe URL changes with each app version, so `localStorage` data is lost when you publish an update. Use [Redis](../server/redis.mdx) for data that needs to persist across app versions. |
| App bundle size | Your app bundle can be at most 32 MB. Larger bundles can't be loaded, so `devvit upload`, `devvit playtest`, and `devvit publish` reject them. See [App bundle size](#app-bundle-size). |

Devvit Web still has the same technical requirements:

- Server endpoint calls
- Max request time: 30s
- Max payload size: 4MB
- Max response size: 10MB
- Max app bundle size: 32MB
- HTML/CSS/JS only

### App bundle size

Your app bundle contains your compiled server code and its source maps. Your client files (HTML, CSS, JavaScript, images, and other assets) are uploaded separately and only add a short reference per file to the bundle, so they don't count toward the limit.

If your bundle is larger than 32 MB, the CLI stops the upload and lists the largest parts of the bundle, such as your server code and server source map. To shrink your bundle:

- Avoid importing large files (JSON data, images, fonts, WASM, and similar) into your server code. Serve them as static client assets or store the data elsewhere.
- Remove dependencies your server doesn't use, or replace large ones with lighter alternatives.
- Enable minification in your server build.
- Keep source maps small: don't inline them into your code, and consider turning off `sourcesContent`.

## Devvit Web components

Devvit Web uses endpoints between the client and server to make communication similar to standard web apps. A Devvit Web app has three components:
Expand Down
1 change: 1 addition & 0 deletions docs/guides/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ The main limits are:

- [Redis](../capabilities/server/redis.mdx): 5 GB max storage per installation for published apps (100 MB for unpublished apps), 5 MB max request size, and 40,000 max commands per second.
- [Devvit Web](../capabilities/devvit-web/devvit_web_overview.mdx): 30 seconds per request, a 4 MB request payload, and a 10 MB response.
- [App bundle](../capabilities/devvit-web/devvit_web_overview.mdx#app-bundle-size): 32 MB for your compiled server code and source maps. Client assets don't count toward it.
- [Post data](../capabilities/server/post-data.mdx): 2 KB per post.
- [Settings and secrets](../capabilities/server/settings-and-secrets.mdx): 2 KB per setting value.
- [Realtime](../capabilities/realtime/overview.md): 1 MB maximum message payload and 100 messages per second per installation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,28 @@ As with most experimental features, there are some caveats.
| Single request and single response handling only | Streaming or chunked responses and websockets are not supported. Long-polling is supported if it's under the max request time. |
| No external requests from your client | You can't have any external requests other than the app's webview domain. All backend responses are locked down to the webview domain via CSP. (Your backend can make external fetch requests though.) |
| localStorage clears on app updates | The iframe URL changes with each app version, so `localStorage` data is lost when you publish an update. Use [Redis](../server/redis.mdx) for data that needs to persist across app versions. |
| App bundle size | Your app bundle can be at most 32 MB. Larger bundles can't be loaded, so `devvit upload`, `devvit playtest`, and `devvit publish` reject them. See [App bundle size](#app-bundle-size). |

Devvit Web still has the same technical requirements:

- Server endpoint calls
- Max request time: 30s
- Max payload size: 4MB
- Max response size: 10MB
- Max app bundle size: 32MB
- HTML/CSS/JS only

### App bundle size

Your app bundle contains your compiled server code and its source maps. Your client files (HTML, CSS, JavaScript, images, and other assets) are uploaded separately and only add a short reference per file to the bundle, so they don't count toward the limit.

If your bundle is larger than 32 MB, the CLI stops the upload and lists the largest parts of the bundle, such as your server code and server source map. To shrink your bundle:

- Avoid importing large files (JSON data, images, fonts, WASM, and similar) into your server code. Serve them as static client assets or store the data elsewhere.
- Remove dependencies your server doesn't use, or replace large ones with lighter alternatives.
- Enable minification in your server build.
- Keep source maps small: don't inline them into your code, and consider turning off `sourcesContent`.

## Devvit Web components

Devvit Web uses endpoints between the client and server to make communication similar to standard web apps. A Devvit Web app has three components:
Expand Down
1 change: 1 addition & 0 deletions versioned_docs/version-0.15/guides/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ The main limits are:

- [Redis](../capabilities/server/redis.mdx): 5 GB max storage per installation for published apps (100 MB for unpublished apps), 5 MB max request size, and 40,000 max commands per second.
- [Devvit Web](../capabilities/devvit-web/devvit_web_overview.mdx): 30 seconds per request, a 4 MB request payload, and a 10 MB response.
- [App bundle](../capabilities/devvit-web/devvit_web_overview.mdx#app-bundle-size): 32 MB for your compiled server code and source maps. Client assets don't count toward it.
- [Post data](../capabilities/server/post-data.mdx): 2 KB per post.
- [Settings and secrets](../capabilities/server/settings-and-secrets.mdx): 2 KB per setting value.
- [Realtime](../capabilities/realtime/overview.md): 1 MB maximum message payload and 100 messages per second per installation.
Expand Down
Loading