Django, Python, Web Development.
if you know the data won’t change frequently. from django.core.cache import cache def get_expensive_data(): data = cache.get('expensive_data') if not data: data = list(ExpensiveModel.objects.all()) cache.set('expensive_data', data, 60 * 15) # Cache for 15 minutes return data Monitoring and