Granada  1.54.0
Structured layer on top of C++ REST SDK for building server applications in C++. Granada implements sessions, server side plug-in framework, C++ OAuth 2.0 server, data storage access, server script running, server browsing.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Member Functions | List of all members
granada::cache::WebResourceCache Class Reference

#include <web_resource_cache.h>

Public Member Functions

 WebResourceCache ()
 
granada::cache::Resource GetFile (std::string &file_path)
 
std::string GetContentEncoding ()
 
void CacheRecord (const std::string &resource_path, const granada::cache::Resource &resource)
 

Detailed Description

Handles the cache of website or web application.

Constructor & Destructor Documentation

granada::cache::WebResourceCache::WebResourceCache ( )

Constructor

Member Function Documentation

void granada::cache::WebResourceCache::CacheRecord ( const std::string &  resource_path,
const granada::cache::Resource resource 
)

Insert a record in the files_ unordered map.

Parameters
resource_pathPath of the resource, it has to be unique.
resourceResource.
std::string granada::cache::WebResourceCache::GetContentEncoding ( )

Returns content encoding: can be gzip or empty string.

Returns
string Content encoding: gzip | empty string.
granada::cache::Resource granada::cache::WebResourceCache::GetFile ( std::string &  file_path)

Returns Resource type of file containing the "Content type", the "Content encoding" and the content of the resource. This content could be cached or not, if it is not cached it will retrieve the information from a file in the hard drive.

Parameters
file_pathRelative path of the file. In the case of the http_request, it will be the relative uri path.
Returns
string Content type of the file.

The documentation for this class was generated from the following file: