Added a cache mixin.

Borrowed from https://bitbucket.org/nextscreenlabs/django-viewclass-mixins/
Licenses are compatitable (both BSD-3).
Oh I have to import those. Sorry. Will do so later today.

On Wed, Dec 17, 2014 at 7:28 PM, Kenneth Love <notifications@github.com>
wrote:
>
> In braces/views/_other.py
> <https://github.com/brack3t/django-braces/pull/159#discussion-diff-21988564>
> :
>
> > +                response.status_code in [200, 203, 206, 410])
> > +
> > +    def dispatch(self, request, *args, **kwargs):
> > +        response = super(HttpCacheMixin, self).dispatch(request, *args, **kwargs)
> > +        if self.cacheable(request, response):
> > +            last_modified = self.get_last_modified()
> > +            if last_modified is not None:
> > +                response['Last-Modified'] = last_modified
> > +            etag = self.get_etag()
> > +            if etag is not None:
> > +                response['ETag'] = etag
> > +            cache_timeout = int(self.get_cache_timeout())
> > +            patch_response_headers(response, cache_timeout)
> > +            cache_varies = self.get_cache_varies()
> > +            if len(cache_varies):
> > +                patch_vary_headers(response, cache_varies)
>
> Same question about patch_vary_headers()
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/brack3t/django-braces/pull/159/files#r21988564>.
>