Skip to main content
Version: v3

Global Configuration

globalConfig()

Global Configuration.

  • Type
function globalConfig(config: AlovaGlobalConfig): void;
  • Parameter
  1. config: Configuration
Parameter nameTypeDescription
autoHitCache'global' | 'self' | 'close'Default is global, global means that cache can be invalidated across multiple Alova instances, self means that only the cache of the current Alova instance is invalidated, and close means that the automatic invalidation cache is turned off
ssrboolean | undefinedDefault is undefined, which means that it is up to alova to determine whether it is running on the server.
  • Return

None

  • Example
import { globalConfig } from 'alova';

globalConfig({
autoHitCache: 'self',
ssr: true
});