Перейти к содержимому

Experimental collection storage

Это содержимое пока не доступно на вашем языке.

Type: "single-file" | "chunked" | { type: "chunked", chunkSize: number }
Default: "single-file"

Добавлено в: astro@7.1.0 Новое

This experimental feature allows you to change how content collections’ data is stored.

By default, Astro stores this data in a single file at .astro/data-store.json. When set to "chunked", Astro splits the data across multiple files inside the .astro/data-store/ folder.

astro.config.mjs
import { defineConfig } from "astro/config";
export default defineConfig({
experimental: {
collectionStorage: "chunked"
}
});

In chunked mode, files are split across multiple chunks. Astro creates a new chunk when the current chunk is larger than 20 MB.

Alternatively, you can change the limit. This is useful if you have particular limits set by your runtime or host.

The following example reduces the limit to 1MB:

astro.config.mjs
import { defineConfig } from "astro/config";
export default defineConfig({
experimental: {
collectionStorage: {
type: "chunked",
chunkSize: 1024 * 1024
}
}
});

This option is recommended when deploying to platforms that have a size limit for individual assets.

Внести свой вклад Сообщество Поддержать