Skip to content

Commit

Permalink
Add request timeout section to upload documentation (#1907)
Browse files Browse the repository at this point in the history
* Add section about request timeout to upload plugin documentation

* typo

* typo

* better wording

* Update docusaurus/docs/dev-docs/plugins/upload.md

---------

Co-authored-by: Pierre Wizla <[email protected]>
  • Loading branch information
SimonStorlSchulke and pwizla authored Nov 8, 2023
1 parent b515cb8 commit b10d8a9
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions docusaurus/docs/dev-docs/plugins/upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,51 @@ export default {

</Tabs>

### Upload request timeout

By default, the value of `strapi.server.httpServer.requestTimeout` is set to 330 seconds. This includes uploads. To make it possible for users with slow internet connection to upload large files, it might be required to increase this timeout limit. The recommended way to do it is by setting the `http.serverOptions.requestTimeout` parameter in the `config/server.js|ts` file (see [server configuration](/dev-docs/configurations/server).
An alternate method is to set the `requestTimeout` value in the `bootstrap` function that runs before Strapi gets started. This is useful in cases where it needs to change programmatically — for example, to temporarily disable and re-enable it:


<Tabs groupId="js-ts">

<TabItem value="javascript" label="JAVASCRIPT">

```js title="path: ./index.js"

module.exports = {

//...

bootstrap({ strapi }) {
// Set the requestTimeout to 1,800,000 milliseconds (30 minutes):
strapi.server.httpServer.requestTimeout = 30 * 60 * 1000;
},
};
```

</TabItem>

<TabItem value="typescript" label="TYPESCRIPT">

```ts title="path: ./index.ts"

export default {

//...

bootstrap({ strapi }) {
// Set the requestTimeout to 1,800,000 milliseconds (30 minutes):
strapi.server.httpServer.requestTimeout = 30 * 60 * 1000;
},
};
```

</TabItem>

</Tabs>


### Responsive Images

When the `Enable responsive friendly upload` setting is enabled in the settings panel the plugin will generate the following responsive image sizes:
Expand Down

0 comments on commit b10d8a9

Please sign in to comment.