57 friend class RemoteResourceTest;
60 std::shared_ptr<http::url> d_remoteResourceUrl;
75 std::string d_resourceCacheFileName;
81 std::vector<std::string> *d_response_headers;
84 std::map<std::string, std::string> *d_http_response_headers;
87 long long d_expires_interval;
95 void setType(
const std::vector<std::string> *resp_hdrs);
101 void writeResourceToFile(
int fd);
107 void ingest_http_headers_and_type();
119 void filter_retrieved_resource(
const std::map<std::string, std::string> &content_filters);
125 bool cached_resource_is_expired();
130 void update_file_and_headers();
137 void update_file_and_headers(
const std::map<std::string, std::string> &content_filters);
142 void load_hdrs_from_file();
146 d_remoteResourceUrl(), d_fd(0), d_initialized(
false), d_resourceCacheFileName(
""),
147 d_response_headers(0), d_http_response_headers(0), d_expires_interval(HttpCache::getCacheExpiresTime()) {
154 RemoteResource(std::shared_ptr<http::url> target_url,
const std::string &uid =
"",
long long expires_interval = HttpCache::getCacheExpiresTime());
159 void retrieveResource(
const std::map<std::string, std::string> &content_filters);