fbpx
Want To Add Extra Images Per Product Variation? Download This Free Plugin

Cache API Response

Ferid Bilgic

Hi,

Can anyone tell me what ths new options does?

Cache API Response – Cache API Response in Browser

Hakik Zaman

Hi Ferid,

Thanks for reaching out to us.

By enabling this option, the variation data will be stored in the browser cache.

You can also increase or decrease the time of the caching.

Then the Swatches data will be served from the browser cache.

It will not hit your server to get product variation data.

I hope this will clear up your confusion.

Note: This option is not recommended if your inventory fluctuates frequently.

Thank You

Ferid Bilgic

Hi Hakik.

 

Thank you for explaining.

Is this meant to speed up the site? What are the thoughts behind this feature?

I am asking because I have 1 or more products with many variations that are loading very slowly.

Hakik Zaman

Hi Ferid,

Is this meant to speed up the site? What are the thoughts behind this feature?

Yes, it will speed up your site, because, the swatches data will be cached and served from the local storage (for 2 mins).

If a visitor lands on your site and visits products with variations, it will be stored variation data on their local machine for some time. So, if they revisit a product (that has already cached on their local machine), will not hit your server and load swatches immediately on their end.

I hope this explanation will help.

Thank You

Ferid Bilgic

Hi Hakik,

That sounds promising. I will try it out, as our inventory doens’t fluctuate frequently.

Regarding the Cache Max Age, what would be the down side of increasing this to for example 15 min or even more?

Ferid Bilgic

Also, how about any of these settings to speed up loading product pages with many variations?

Archive variation threshold: 10

Attribute display limit: 0

Hakik Zaman

Hi Ferid,

Regarding the Cache Max Age, what would be the down side of increasing this to for example 15 min or even more?

As it will cache the variation data and the stock, increasing the time could display a false stock status.

Also, how about any of these settings to speed up loading product pages with many variations?

Based on the archive threshold value, our plugin decides whether it will call the API for fetching Swatches data or display swatches using the default WooCommerce way or HTML rendering way.

When you increase it to 10, it means our plugin will not call the API for those products that have up to 10 variations.

For more than 10 variations, it will fetch data using the API.

Difference between API call and non-API call.

=> When calling API, your site’s other data (like- Banner, and Navbar) will load first. Then our swatches will be fetched using one-by-one product IDs (when the products will display on the browser viewport).

=> When not calling API, the swatches data will load and render with the whole site data (like- Banner, and Navbar) together. So, your webpage will not load till the Swatches data are fetched.

I hope this explanation will help.

Thank You