Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(14)  |  Call(14)  |  Derive(0)  |  Import(0)
Set cache-related headers.

:param timestamp: local timestamp of the last modification of the
    response content
:param etag_data: list that will be used to build an ETag hash.
    calls the str function on each item.
:param max_age: the maximum cache age in seconds

src/m/a/MapProxy-1.6.0/mapproxy/service/wms.py   MapProxy(Download)
        if query.tiled_only and isinstance(result.cacheable, CacheInfo):
            cache_info = result.cacheable
            resp.cache_headers(cache_info.timestamp, etag_data=(cache_info.timestamp, cache_info.size),
                               max_age=self.max_tile_age)
            resp.make_conditional(map_request.http)
 
        if not result.cacheable:
            resp.cache_headers(no_cache=True)

src/m/a/MapProxy-1.6.0/mapproxy/service/tile.py   MapProxy(Download)
        resp = Response(tile.as_buffer(), content_type='image/' + tile_format)
        if tile.cacheable:
            resp.cache_headers(tile.timestamp, etag_data=(tile.timestamp, tile.size),
                               max_age=self.max_tile_age)
        else:
            resp.cache_headers(no_cache=True)

src/m/a/mapproxy-HEAD/mapproxy/service/wms.py   mapproxy(Download)
        if query.tiled_only and isinstance(result.cacheable, CacheInfo):
            cache_info = result.cacheable
            resp.cache_headers(cache_info.timestamp, etag_data=(cache_info.timestamp, cache_info.size),
                               max_age=self.max_tile_age)
            resp.make_conditional(map_request.http)
 
        if not result.cacheable:
            resp.cache_headers(no_cache=True)

src/m/a/mapproxy-HEAD/mapproxy/service/tile.py   mapproxy(Download)
        resp = Response(tile.as_buffer(), content_type='image/' + tile_format)
        if tile.cacheable:
            resp.cache_headers(tile.timestamp, etag_data=(tile.timestamp, tile.size),
                               max_age=self.max_tile_age)
        else:
            resp.cache_headers(no_cache=True)

src/m/a/MapProxy-1.6.0/mapproxy/service/kml.py   MapProxy(Download)
        resp = Response(tile.as_buffer(),
                        content_type='image/' + tile_format)
        resp.cache_headers(tile.timestamp, etag_data=(tile.timestamp, tile.size),
                           max_age=self.max_tile_age)
        resp.make_conditional(map_request.http)
            initial_level=initial_level, tile_size=tile_size)
        resp = Response(result, content_type='application/vnd.google-earth.kml+xml')
        resp.cache_headers(etag_data=(result,), max_age=self.max_tile_age)
        resp.make_conditional(map_request.http)
        return resp

src/m/a/mapproxy-HEAD/mapproxy/service/kml.py   mapproxy(Download)
        resp = Response(tile.as_buffer(),
                        content_type='image/' + tile_format)
        resp.cache_headers(tile.timestamp, etag_data=(tile.timestamp, tile.size),
                           max_age=self.max_tile_age)
        resp.make_conditional(map_request.http)
            initial_level=initial_level, tile_size=tile_size)
        resp = Response(result, content_type='application/vnd.google-earth.kml+xml')
        resp.cache_headers(etag_data=(result,), max_age=self.max_tile_age)
        resp.make_conditional(map_request.http)
        return resp

src/m/a/MapProxy-1.6.0/mapproxy/service/wmts.py   MapProxy(Download)
        # set the content_type to tile.format and not to request.format ( to support mixed_mode)
        resp = Response(tile.as_buffer(), content_type='image/' + tile.format)
        resp.cache_headers(tile.timestamp, etag_data=(tile.timestamp, tile.size),
                           max_age=self.max_tile_age)
        resp.make_conditional(request.http)

src/m/a/mapproxy-HEAD/mapproxy/service/wmts.py   mapproxy(Download)
        # set the content_type to tile.format and not to request.format ( to support mixed_mode)
        resp = Response(tile.as_buffer(), content_type='image/' + tile.format)
        resp.cache_headers(tile.timestamp, etag_data=(tile.timestamp, tile.size),
                           max_age=self.max_tile_age)
        resp.make_conditional(request.http)