'Cache remote resources'

@api.response(200, description=u'Cached    resource')
@api.response(BadRequest)
@api.response(APIError)
@api.doc(parser=cached_parser)
def get(self, session=None):

    args = cached_parser.parse_args()
    url = args.get(u'url')
    force = args.get(u'force')
    try:
        (file_path, mime_type) = cached_resource(url, self.manager.config_base, force=force)
    except RequestException as e:
        raise BadRequest(u'Request    Error:    {}'.format(e.args[0]))
    except OSError as e:
        raise APIError(u'Error:    {}'.format(str(e)))
    return send_file(file_path, mimetype=mime_type)
