Caching

Upsell Product Add-On App can be configured to use browser's session storage to cache Add-Ons and Settings, this can hugely improve load time as app does not have to fetch data from remote storage each time a product page or cart page is loaded. Caching is very common technique used in mordern web apps to improve performance.

Configure Caching

If you have just installed the Upsell Product Add-Ons App, firstly create all our necessary Add-Ons and once you are happy with appearance of the add-ons, go to "Settings" page in the App Admin and click on "Cache Add-Ons" Checkbox under Preferences tab, as shown in the screenshot below, then visit your home page and browse to a product page and you will notice a difference in app loading time.

Updating or Changing Add-Ons & Preferences after they are cached.

Once you have configured caching and you need to update the Add-ons or change preferences, you might notice that changes you are making in the App admin is not immediately visible on your site, this is because Add-Ons and Preferenes are cached for a duration of 15 minutes. In order to test your changes perform following steps:

  1. Disable the Caching by un-checking the "Cache Add-Ons" checkbox

  2. Visit your home page with an additional parameter of ?upsell-cache-clear appended to your shop url, so for example your shop url is https://www.MyShop.com and visit the Shop using https://www.MyShop.com?upsell-cache-clear

Now your changes made in App admin will appear, once you are done with making changes re-enable caching by checking the "Cache Add-Ons" checkbox

Will my user get latest Add-Ons?

Add-Ons and Preferences are cached for 15 minutes and will be re-fetched after every 15 minutes.

Also Add-Ons are cached in a single session i.e if a user closes the browser and re-visits, Add-Ons will be re-fetched.