Fresh

Caching

Understanding how Fresh caches documentation

Fresh caches fetched pages to improve performance and reduce server load.

How Caching Works

When you fetch a page, Fresh stores it in ~/.fresh/cache/. Subsequent requests check the cache first.

Cache Headers

Fresh respects HTTP caching headers:

  • Cache-Control
  • ETag
  • Last-Modified

If no headers are present, Fresh uses default TTL values.

Cache Management

View Cache Location

ls ~/.fresh/cache/

Clear Cache

# Force refresh a specific URL
fresh get https://example.com/ --no-cache

# Clear all cache
rm -rf ~/.fresh/cache/

Sync Force Refresh

fresh sync https://docs.python.org/3/ --force

Cache Configuration

Environment Variables

VariableDescription
FRESH_CACHE_DIROverride cache directory

TTL Values

Source TypeDefault TTL
Documentation sites24 hours
API responses1 hour

Performance Tips

  1. Use aliases - Cached for quick access
  2. Sync for offline - No network needed
  3. Limit sync scope - Only what you need

Troubleshooting

Stale Content

If content seems outdated:

fresh get <URL> --no-cache

Cache Full

# Check cache size
du -sh ~/.fresh/cache/

# Clear old entries
fresh sync --force

On this page