if is_authenticated:
    return render_user(request)
else:
    return render_visitor(request)

@cache_page(5, key_prefix='user_cache')
def render_user(request):
    print('refreshing user_cache')
return render(request, 'home-user.html', {})

@cache_page(10, key_prefix='visitor_cache')
def render_visitor(request):
    print('refreshing visitor_cache')
return render(request, 'home-visitor.html', {})
Django Caching for Authenticated Users Only