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 in custom queries:
- Check the custom queries in your project that use the
POSTmethod. - Rename the queries by adding the
Querysuffix to default toGET. For example:
- Uncached (
POST):getOrderForm - Cached (
GET):getOrderFormQuery(ensures proper store caching)