Backend Development
Django
Subjective
Oct 03, 2025
Explain Django caching strategies and implementation.
Detailed Explanation
Caching improves performance by storing computed data.
Types:
• Per-site cache - entire site
• Per-view cache - @cache_page decorator
• Template fragment cache - {% cache %}
• Low-level cache API
Backends:
• Database
• File system
• Memcached
• Redis
Features:
• Cache keys, timeouts, versioning
• Cache invalidation strategies
Example:
from django.core.cache import cache
cache.set('key', 'value', 300)
Discussion (0)
No comments yet. Be the first to share your thoughts!
Share Your Thoughts