Cache Information

How long we keep each supplier answer, and how to skip it

When you call a PromoStandards endpoint through PSRESTful, we keep the supplier's answer for a while. The next call for the same thing gets the stored copy back without waiting on the supplier. Product details, images and pricing change slowly, so we keep them longest. Stock changes all day, so we keep it for a few hours.

Why Caching Matters

Importing a supplier's whole catalog means one Product Data, one Media Content and several Pricing and Configuration (PPC) calls per product, and each one waits on the supplier's server. With the answers cached, a second import of the same catalog, or a second system asking for the same products, doesn't wait on the supplier again.

Cache Time for Each Service

Every path below starts with /v{version}/suppliers/{supplier_code}, for example /v2.0.0/suppliers/{supplier_code}/products/{product_id}.

How long PSRESTful keeps each answer
Service Method PSRESTful Endpoint Cache Time
Product DatagetProductSellable/sellable-products, /sellable-product-ids, /sellables1 day
Product DatagetProduct/products/{product_id}1 week
Product DatagetProductCloseOut/products-closeout1 day
Product DatagetProductDateModified/products-modified-since4 hours
Media ContentgetMediaContent/medias/{product_id}1 week
Media ContentgetMediaDateModified/media-modified-since1 day
PPCgetAvailableLocations/available-locations/{product_id}1 week
PPCgetDecorationColors/decoration-colors/{product_id}1 week
PPCgetFobPoints/fob-points/{product_id}1 week
PPCgetAvailableCharges/available-charges/{product_id}1 week
PPCgetConfigurationAndPricing/pricing-and-configuration/{product_id}1 week (List and Net prices; Customer prices are never cached)
INVgetInventoryLevels/inventory/{product_id}About 4 hours
INVgetFilterValues/inventory/filter-values/{product_id}Not cached
  • Inventory answers live for 4 hours, give or take up to 30 minutes, so answers stored at the same moment don't all expire at once.
  • Only Production answers are served from the cache. Calls with environment=STAGING always go to the supplier.
  • When a supplier answers with an error, we keep that answer for a shorter time than a normal one. Errors about your supplier credentials aren't kept at all, so a corrected password works on the next call.
  • Order Status, Order Shipment Notification (OSN), Invoice and Purchase Order calls aren't cached: each one goes to the supplier.

Skipping the cache: add the header Cache-Control: no-cache to your request and PSRESTful asks the supplier, then stores the new answer for the next caller. With Cache-Control: no-store, the answer you get isn't stored.

One exception: for products whose images PSRESTful has already imported, Media Content answers come from our imported copy, and the header doesn't change that.