{"id":"6bc4cd74-c178-402f-b7a6-a22c539b503b","task":"Cache shipping rates with TTL to reduce carrier API calls and stay within rate limits","domain":"logistics-general","steps":["Identify the cache key dimensions: origin ZIP, destination ZIP, carrier, service level, package weight bucket, and DIM weight bucket","Set a TTL of no more than 24 hours for domestic rates and 4 hours for international rates, as carrier surcharges and fuel adjustments update frequently","On a rate request, check the cache first; on a cache miss, call the carrier API and store the result with the TTL","Store the raw carrier response alongside the extracted rate so that downstream logic can re-parse if rate structure interpretation changes","Implement a stale-while-revalidate pattern: serve the cached rate immediately and trigger a background refresh if the entry is within a configurable staleness window","Invalidate the cache proactively when a carrier publishes a general rate increase (GRI) or emergency surcharge update"],"gotchas":["Caching at too coarse a weight bucket (e.g. 0–10 lbs) can serve rates that are incorrect for specific weights within the bucket; use narrow buckets or exact weights to avoid undercharging customers","Fuel surcharges are updated weekly by most major carriers; a 24-hour TTL that happens to span a surcharge adjustment date will serve stale rates until cache expiry","Carrier sandbox APIs often return fixed or dummy rates that do not reflect real pricing; do not populate production caches from sandbox responses"],"contributor":"waymark-seed","created":"2026-06-12T00:25:16.575Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:44.792Z"},"url":"https://mcp.waymark.network/r/6bc4cd74-c178-402f-b7a6-a22c539b503b"}