title: Cache-Control not being set in response header
body: <p>I am trying to optimize my Django web application by leveraging browser caching. I set a Cache-Control header for max-age equal to a year in my home view function returned response. When I load up my site however, and check the response header of some of the images on my home page, the cache-control header isn't there. I tried two different methods of setting the response header. First I tried using Django's built in cache-control decorator. I also tried simply taking the rendered response, and setting the header in my view function before its return statement. Are static images cached differently ?</p>
  
  <p>View Function</p>
  
  <pre><code>def view_home(request, page=None):
      # FIND THE HOME PAGE IF WE DO NOT HAVE ONE
      # IF NOT FOUND RETURN 404
      if not page:
          try:
              page = WebPage.objects.get(template='home')
  
          except WebPage.DoesNotExist:
              raise Http404
  
      try:
          billboards = Billboard.get_published_objects()
  
      except Exception as e:
          logging.error(e)
          billboards = None
  
      project_types = ProjectType.get_published_objects()
      budgets = Budget.get_published_objects()
      deadlines = Deadline.get_published_objects()
      contact_descriptions = ContactDescription.get_published_objects()
  
      contact_form = ContactForm(type_list=project_types, budget_list=budgets,
                                 deadline_list=deadlines, description_list=contact_descriptions)
  
      context = {'page': page, 'billboards': billboards, 'contact_form': contact_form}
      set_detail_context(request, context)
  
      template = 'home.html'
  
      # Add Cache control to response header
      expiry_date = datetime.datetime.now() + datetime.timedelta(days=7)
      response = render(request, template, context)
  
      response['Cache-Control'] = 'max-age=602000'
      response['Expires'] = expiry_date
  
      return response
  </code></pre>