Introducing Real-Time Shipping Protection: 200ms Quote Generation
Today we are excited to announce our new quote engine that delivers real-time shipping protection quotes in under 200ms. This represents a 10x improvement over our previous system and enables truly seamless checkout experiences.
Why Speed Matters
In e-commerce, every millisecond counts. Studies show that a 100ms delay in page load time can decrease conversion rates by 7%. When it comes to checkout, where customers are most likely to abandon their carts, speed is even more critical.
Our customers told us they wanted shipping protection to feel like a native part of their checkout flow, not an interruption. That meant we needed to deliver quotes faster than a customer could notice.
The Technical Challenge
Generating an insurance quote involves several complex calculations:
- Risk Assessment: Evaluating the shipping route, carrier, item category, and historical claim data
- Premium Calculation: Applying actuarial models to determine the appropriate price
- Underwriting Rules: Checking eligibility and coverage limits
- Fraud Detection: Screening for suspicious patterns
Traditionally, these operations happen sequentially and can take several seconds. Our challenge was to parallelize and optimize each step without sacrificing accuracy.
Our Solution: Multi-Tier Caching
We implemented a multi-tier caching strategy that dramatically reduces response times:
// L1: Application Memory Cache (< 1ms)
// L2: Redis Cluster (< 5ms)
// L3: Computed on Demand (< 200ms)
async function getQuote(params: QuoteParams) {
// Check L1 cache (in-memory)
const l1Key = computeCacheKey(params);
if (memoryCache.has(l1Key)) {
return memoryCache.get(l1Key);
}
// Check L2 cache (Redis)
const cached = await redis.get(l1Key);
if (cached) {
memoryCache.set(l1Key, cached);
return cached;
}
// Compute quote with parallelized operations
const [risk, rules, fraud] = await Promise.all([
assessRisk(params),
checkRules(params),
screenFraud(params),
]);
const quote = calculatePremium(risk, rules, fraud);
// Cache for future requests
await redis.setex(l1Key, 3600, quote);
memoryCache.set(l1Key, quote);
return quote;
}Results
The new quote engine delivers impressive performance improvements:
- p50 latency: 45ms (was 450ms)
- p95 latency: 120ms (was 1.2s)
- p99 latency: 195ms (was 2.5s)
- Cache hit rate: 85%
For our customers, this translates to a checkout experience where shipping protection feels instant.
What This Means for You
If you are already using CoverKit, you will automatically benefit from these improvements. No code changes are required.
If you are considering adding shipping protection to your platform, now is a great time to get started. Our new quote engine makes integration simpler and provides a better experience for your customers.
Get Started
Ready to add shipping protection to your checkout? Check out our Getting Started Guide or sign up for a free account today.