TTL incorrect caching with query params

Hi!
We faced with issue that builder with TTL is incorrect cached url with query params. Do you have any suggesting how we can bypass it?

https://dev-composable-storefront.netlify.app/search?q=sony
https://dev-composable-storefront.netlify.app/search?q=123

Hi, @super12431. The On-demand Builders functions do not take query parameter into account when caching. To On-demand Builders, these two URLs are identical with regards to caching as, without the query parameters, they are identical:

original URL URL without query parameters:
https://dev-composable-storefront.netlify.app/search?q=sony https://dev-composable-storefront.netlify.app/search
https://dev-composable-storefront.netlify.app/search?q=123 https://dev-composable-storefront.netlify.app/search

The solution for this is to make a redirect that modifies the URLs to the query parameters become part of the path itself. That documentation is found here:

https://docs.netlify.com/configure-builds/on-demand-builders/#redirect-workaround-for-query-parameters

If there are other questions, please reply here anytime.