Cache

Introduction

Cache features are optional features that can be used to make the page loads quite a bit faster. These features mean that api requests are not always made and the created content is loaded from cache instead.

GoErp implements 2 different caching options. The options are disabled by default as it can affect the behaviour of the pages quite a bit.

The cache settings are only available for page type templates. The settings area can be found under the ‘Publish settings’ area in the template edit view.

Cache settings Cache settings

Browser cache headers

Cache is separate for every client.

This feature utilizes the default browsers cache mechanism using the modified date values and cache max-age modifiers. With this feature the browser caches the contents and sends a request with the modified date value on the next request, the server will respond with not modified if the value has not changed.

Note that the modified value in this case it the date when the page template was updated, any changes from used api’s in the template do not update the value.

Can be used to speed up templates that do not always need the most up-to-date values. You can specify the max-age in seconds. Content will be re-loaded if the max-age is reached or the template page is updated.

GoErp server cache

Single cached element for all clients.

The feature caches the contents on the server instead and returns the data without running the api requests. The cached data is shared between multiple requests.

Should only be used on pure static pages or pages that serve non-current session related data.

A custom age value can be provided in minutes.

Use cases

  1. Mostly static data pages.
  2. Pages that run slow running api requests or api mock pages where fresh by the second data is not always required.
  3. Browser cache headers with a small age can also be used to make a false sense of speed or reduce possible flickering, but note if the data indeed changes it can appear jumpy depending on the layout of the page.