---
url: https://gudhub.com/uk/docs/ssr-ssg/website/caching/
title: "Caching\n                #"
description: "The cache on the GudHub server has several different uses. Namely, a few modes of server operation use the cache differently. Each of them makes the server work"
lang: uk
updated: 2026-09-12T08:46:23.104Z
---

# Caching [#](https://gudhub.com/uk/docs/ssr-ssg/website/caching/#caching)

The cache on the GudHub server has several different uses. Namely, a few modes of server operation use the cache differently. Each of them makes the [server](https://gudhub.com/uk/docs/ssr-ssg/server/ssr-ssg-server/) work a little differently.

## Production Mode [#](https://gudhub.com/uk/docs/ssr-ssg/website/caching/#production-mode)

The current mode is intended for the site to **return cached pages**. This mode is used mostly for a ready-made website. To enable this mode, open the `.env` file and enter:

Копіювати

```json
    MODE=production
```

Originally, the page has no cache, but when you open it for the first time, it generates one. That's why the first user may have to wait quite a long time for the page to be generated, but all subsequent times it will be much faster due to the cache that was obtained for the first time. After that, every time any user opens the page, that cache will be used.

## SSR Mode [#](https://gudhub.com/uk/docs/ssr-ssg/website/caching/#ssr-mode)

Due to this mode, the server do not use the existing cache. It accesses the dist folder where the built files are located and generates a new cache based on them. So, this mode is useful when you need to update the content of the page.

To use it, take the page you wanna regenerate and add `?mode=ssr` in the end of it, like here:

Копіювати

```json
    gudhub.com/news/?mode=ssr
```

> Please note that this mode is not activated in the `.env` file.

The second mode works in conjunction with the [previous one](#production-mode). This means that you need to set the [production](#production-mode) mode in `.env` and only then activate the current.

### Image Generation [#](https://gudhub.com/uk/docs/ssr-ssg/website/caching/#image-generation)

As you know, it is hard for server to work with images. If your site has a large number of images, it can take a long time to generate them. So, the server has a feature that allows you to prevent repeated image generation.

To use this feature enter the `disable-images-regeneration=true` string after the `mode=ssr`:

Копіювати

```json
    https://:www.gudhub.com/news/?mode=ssr&disable-images-regeneration=true
```

> That is, this function can be used **only in combination with the** [SSR mode](#ssr-mode).

## Multiple SSR [#](https://gudhub.com/uk/docs/ssr-ssg/website/caching/#multiple-ssr)

When you have a large number of pages that need to be re-generated using [SSR mode](#ssr-mode), it is inconvenient and time-consuming to do it one page at a time. To solve this problem, the GudHub server has a special request. It allows you to re-generate an array of pages at once.

To use this method you have to send the request to your local server that looks like this:

Копіювати

```json
    http://127.0.0.1:7777/generate-pages/
```

The request body contains two properties:

Копіювати

```json
{
    "pages": "/news/",
    "website": "gudhub.com"
}
```

| Property Name | Type | Description |
| :-- | :-- | :-- |
| pages | `string` | _allows you to **filter pages.** That is, those pages that **meet the conditions specified here will be re-generated**. For example, you can specify a category name like `/news/` or even a word that appears in the links of the desired pages_ |
| website | `string` | _transfer the **site whose pages will be re-generated**_ |

> This request does not re-generate images that are not updated. This is because the [feature described in the previous chapter](#image-generation) is **active here by default**.

This mode takes pages from all sitemaps and creates an array. If the `pages` property is empty, it processes all pages from the sitemaps. Otherwise, it filters the pages and processes those that satisfy the conditions.

## Development Mode [#](https://gudhub.com/uk/docs/ssr-ssg/website/caching/#development-mode)

The last mode always returns the latest version of the site.

> In this case, the **cache is saved but not used**.

To use this mode, open the `.env` and enter this here:

Копіювати

```json
    MODE=development
```

It is mainly used in development, but if you are using the latest version of the server, then the simplest site can be raised in this mode in production.
