Just like Single-tenant, Multi-tenant applications can cache contents to improve performance at runtime. Each tenant has its own cache for storing tenant-specific data. Data shared among tenants, i.e., Single-tenant is cached in a centralized way.

Cache Invalidation

To force the evaluation of cached content on the next usage, the OutSystems Platform provides cache invalidation with the following System actions:

EspaceInvalidateCache(eSpaceId,TenantId): allows invalidating the cache either at eSpace level or for a specific Tenant of the eSpace.

If only the eSpace is specified, the cache is invalidated for the eSpace and all its tenants.

Example

In the OnLineShop application, currency exchange rates are shared among all tenants and are updated at the end of the day. When that happens, the cache must be invalidated for all tenants.

By specifying the eSpace and the tenant when using the EspaceInvalidateCache, the cache is invalidated for that specific tenant of the eSpace.

Example

In the OnlineShop application, each tenant has its own product catalog and caching is performed per tenant. When an end-user uploads new products to the catalog, the corresponding tenant cache must be invalidated. By invalidating cache for a specific tenant, you avoid the overhead of invalidating the cache for all tenants.

TenantInvalidateCache(TenantId): allows invalidating cache of a tenant across all eSpaces.

Use the EspaceInvalidateCache instead to constrain the invalidation of cached data for a single eSpace, thus reducing the invalidation impact.

See Also

About Multi-Tenancy | About Caching Contents | Invalidating the Cache