0

I am using django-pipeline to compress my static files, and using

STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'

to keep my static files hashed. But the problem is that the template index.html that includes all the static files gets cached into the browser, so keeps on including the old files and hence Cache busting doesn't work. How do I solve this problem.

I only want index.html to be not cached.

EDIT:

Here is my view function

from django.shortcuts import render

def index(request):
    if(request.user.id):
        data = request.user.profile()
        return render(request, '<app_name>/index.html', {'data': data})
    else:
        return render(request, '<app_name>/index.html')
Mahammad Adil Azeem
  • 9,112
  • 13
  • 57
  • 84

0 Answers0