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}.
| Service | Method | PSRESTful Endpoint | Cache Time |
|---|---|---|---|
| Product Data | getProductSellable | /sellable-products, /sellable-product-ids, /sellables | 1 day |
| Product Data | getProduct | /products/{product_id} | 1 week |
| Product Data | getProductCloseOut | /products-closeout | 1 day |
| Product Data | getProductDateModified | /products-modified-since | 4 hours |
| Media Content | getMediaContent | /medias/{product_id} | 1 week |
| Media Content | getMediaDateModified | /media-modified-since | 1 day |
| PPC | getAvailableLocations | /available-locations/{product_id} | 1 week |
| PPC | getDecorationColors | /decoration-colors/{product_id} | 1 week |
| PPC | getFobPoints | /fob-points/{product_id} | 1 week |
| PPC | getAvailableCharges | /available-charges/{product_id} | 1 week |
| PPC | getConfigurationAndPricing | /pricing-and-configuration/{product_id} | 1 week (List and Net prices; Customer prices are never cached) |
| INV | getInventoryLevels | /inventory/{product_id} | About 4 hours |
| INV | getFilterValues | /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=STAGINGalways 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.