The ce_lookup cache entry lookup function looks up a cache entry for a specified URL.
#include <libproxy/cache.h> CacheEntry *ce_lookup(Session *sn, Request *rq, char *url, time_t ims_c);
NULL if caching is not enabled
A newly allocated CacheEntry structure, whether or not a copy existed in the cache. Within that structure, the ce->state field reports about the existence:
CACHE_NO signals that the document is not and will not be cached. Other fields in the cache structure may be NULL
CACHE_CREATE signals that the cache file doesn’t exist but may be created once the remote server is contacted. However, during the retrieval it may turn out that the document not be cacheable.
CACHE_REFRESH signals that the cache file exists but must be refreshed before being used. The data might still be up to date but the remote server needs to be contacted to find out. If the file is not up to date, the cache file will be replaced with the new document version sent by the remote origin server.
CACHE_RETURN_FROM_CACHE signals that the cache file exists and is up-to-date based on the configuration and current parameters controlling what is considered fresh.
CACHE_RETURN_ERROR is a signal that happens only if the proxy is set to no-network mode connect-Modenese, and the document does not exist in the cache.
Session *sn identifies the Session structure.
Request *rq identifies the Request structure.
char *url contains the name of the URL for which the cache is being sought.
time-out misc. is the if-modified-since time.