JK
JustKalm
Performance

Caching

JustKalm intelligently caches valuations to improve performance and reduce costs. Understand our caching strategy to optimize your integration.

<50ms
Cache hit latency
1 hour
Default TTL
Global
Edge distribution

Cache Headers

Every API response includes cache headers that indicate the caching status and remaining validity.

HeaderDescription
X-JustKalm-CacheHIT or MISS
X-JustKalm-Cache-AgeSeconds since cached
X-JustKalm-Cache-TTLSeconds until expiry
ETagUnique content identifier
Cache-ControlStandard HTTP cache directives
Response Headers Example
HTTP/1.1 200 OK
Content-Type: application/json
Cache-Control: public, max-age=3600, stale-while-revalidate=86400
ETag: "abc123xyz"
X-JustKalm-Cache: HIT
X-JustKalm-Cache-Age: 1823
X-JustKalm-Cache-TTL: 1777

{
  "price_min": 150,
  "price_max": 250,
  ...
}

TTL Policies

Cache duration varies based on item type and market volatility:

Stable Items
24h

Everyday clothing, accessories. Low price volatility.

Standard Items
1h

Designer goods, popular brands. Moderate volatility.

Volatile Items
15m

Limited editions, hyped releases. High market activity.

Conditional Requests

Use ETags for conditional requests to minimize bandwidth and costs. A 304 response means your cached data is still valid.

304 Not Modified

No body returned, use your local cache

Reduced API usage

304 responses don't count against quotas

Lower latency

Minimal response size means faster transfers

Conditional Request
// Use ETag for conditional requests
const response = await fetch('https://api.justkalm.com/v2/valuate', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer jk_live_xxx',
    'If-None-Match': '"abc123xyz"',  // ETag from previous response
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ url: 'https://example.com/item' })
});

if (response.status === 304) {
  // Cached data is still valid, use local cache
  console.log('Using cached valuation');
} else {
  // New data available
  const valuation = await response.json();
}

Cache Invalidation

Force Fresh Data
// Force cache refresh
const response = await fetch('https://api.justkalm.com/v2/valuate', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer jk_live_xxx',
    'Cache-Control': 'no-cache',  // Bypass cache
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ url: 'https://example.com/item' })
});

// Or use the refresh parameter
const fresh = await client.valuate({
  url: 'https://example.com/item',
  refresh: true,  // Force fresh valuation
});

When to Bypass Cache

Real-time pricing needed

For checkout flows where accuracy is critical

Known product changes

When you know the listing was updated

Use sparingly

Fresh requests cost more and are slower

Global Edge Cache

Infrastructure

  • Edge Locations50+ worldwide
  • Cache ProviderCloudflare Enterprise
  • Origin ShieldUS-East, EU-West, AP-Tokyo
  • Avg Cache Hit Rate94%

Cache Layers

L1
Edge Cache
Closest to user, 50+ locations
L2
Regional Cache
Origin shields, 3 regions
L3
Application Cache
Redis cluster, computed results

Need Custom Caching?

Enterprise plans include custom TTL configuration and cache purge APIs.

© 2025 JustKalm. Globally distributed.