Improved
FastStore: Use `GET` requests for custom queries to improve store caching
April, 30
To ensure proper caching behavior when navigating store pages (such as Home, PDP, and PLP), use GET
instead of POST
for API requests in custom queries. GET
requests are cacheable by default, while POST
requests bypass caching.
What has changed?
Previously, some custom queries used POST
methods, which prevented caching. Now, queries with the Query
suffix in their names automatically use GET
. For example, rename getOrderForm
to getOrderFormQuery
.
What needs to be done?
To enable proper caching related to custom queries do the following:
- Review your project's custom queries using
POST
method. - Rename these queries by adding the
Query
suffix to default toGET
. For example:
- Uncached (
POST
):getOrderForm
- Cached (
GET
):getOrderFormQuery
(ensures proper store caching)