def fix_IE_for_vary(request, response):
 useragent = request.META.get('HTTP_USER_AGENT', '').upper()
 if (('MSIE' not in useragent) and ('CHROMEFRAME' not in useragent)):
  return response
 safe_mime_types = ('text/html', 'text/plain', 'text/sgml')
 mime_type = response.get('Content-Type', '').partition(';')[0]
 if (mime_type not in safe_mime_types):
  try:
   del response['Vary']
  except KeyError:
   pass
 return response

def fix_IE_for_vary ( request , response ) : useragent = request . META . get ( 'HTTP_USER_AGENT' , '' ) . upper ( ) if ( ( 'MSIE' not in useragent ) and ( 'CHROMEFRAME' not in useragent ) ) : return response safe_mime_types = ( 'text/html' , 'text/plain' , 'text/sgml' ) mime_type = response . get ( 'Content-Type' , '' ) . partition ( ';' ) [ 0 ] if ( mime_type not in safe_mime_types ) : try : del response [ 'Vary' ] except KeyError : pass return response
this function will fix the bug reported at URL by clearing the vary header whenever the mime-type is not safe enough for internet explorer to handle .