httpRequestAPITimeout

httpRequestAPITimeout

This configuration option was added in Profound.js 7.6.0.

Description

By default, requests made via pjs.httpRequest() use a timeout of 10 seconds. The pjs.httpRequest() call accepts a timeout parameter that overrides the default for an individual request.

The httpRequestAPITimeout setting changes that default for every request sent via pjs.httpRequest() that does not specify its own timeout. Overriding the default is useful with low-code plugins, or when 10 seconds is not appropriate for most of the requests the application makes.

The value is specified in milliseconds.

Example

Shorten the default timeout to three seconds, so that a slow downstream service fails fast instead of holding the session:

httpRequestAPITimeout: 3000 // Set API request time-out to 3 seconds.

httpRequestAPITimeout replaces the deprecated shortHttpTimeout, which in past releases worked with the deprecated pjs.sendRequest() API but not with pjs.httpRequest().

For information on how to modify this setting, see Configuration File.