HTTP Downloader Cache.
More...
This section documents the file HTTP caching tools the GPAC framework.
◆ DownloadedCacheEntry
Handle for Cache Entries. You can use the gf_cache_get_* functions to get the cache properties
◆ GF_CacheReader
◆ gf_cache_delete_entry()
Free The DownloadedCacheEntry handle
- Parameters
-
- Returns
- GF_OK
◆ gf_cache_get_etag_on_server()
Get the ETag associated with this cache entry if any
- Parameters
-
- Returns
- The ETag if any was defined, NULL otherwise
◆ gf_cache_set_etag_on_disk()
Set the eTag in the cache. Data is duplicated, so original string can be freed by caller.
- Parameters
-
entry | The entry |
eTag | The eTag to set |
- Returns
- GF_OK if entry and eTag are valid, GF_BAD_PARAM otherwise
◆ gf_cache_set_etag_on_server()
Set the eTag in the cache. Data is duplicated, so original string can be freed by caller.
- Parameters
-
entry | The entry |
eTag | The eTag to set |
- Returns
- GF_OK if entry and eTag are valid, GF_BAD_PARAM otherwise
◆ gf_cache_get_mime_type()
Get the Mime-Type associated with this cache entry.
- Parameters
-
- Returns
- The Mime-Type (never NULL if entry is valid)
◆ gf_cache_set_mime_type()
Set the Mime-Type in the cache. Data is duplicated, so original string can be freed by caller.
- Parameters
-
entry | The entry |
mime_type | The mime-type to set |
- Returns
- GF_OK if entry and mime-type are valid, GF_BAD_PARAM otherwise
◆ gf_cache_get_url()
Get the URL associated with this cache entry.
- Parameters
-
- Returns
- The Hash key (never NULL if entry is valid)
◆ gf_cache_can_be_cached()
Tells whether a cache entry should be cached safely (no
- Parameters
-
- Returns
- 1 if entry should be cached
◆ gf_cache_get_last_modified_on_server()
Get the Last-Modified information associated with this cache entry.
- Parameters
-
- Returns
- The Last-Modified header (can be NULL)
◆ gf_cache_set_last_modified_on_disk()
Set the Last-Modified header for this cache entry
- Parameters
-
entry | The entry |
newLastModified | The new value to set, will be duplicated |
- Returns
- GF_OK if everything went alright, GF_BAD_PARAM if entry is NULL
◆ gf_cache_set_last_modified_on_server()
Set the Last-Modified header for this cache entry
- Parameters
-
entry | The entry |
newLastModified | The new value to set, will be duplicated |
- Returns
- GF_OK if everything went alright, GF_BAD_PARAM if entry is NULL
◆ gf_cache_get_cache_filename()
Get the file name of cache associated with this cache entry.
- Parameters
-
- Returns
- The Cache file (never NULL if entry is valid)
◆ gf_cache_get_cache_filesize()
Get the real file size of the cache entry
- Parameters
-
- Returns
- the file size
◆ gf_cache_flush_disk_cache()
Flushes The disk cache for this entry (by persisting the property file
- Parameters
-
- Returns
- error if any
◆ gf_cache_set_content_length()
Set content length of resource
- Parameters
-
entry | The entry |
length | size of the content in bytes |
- Returns
- error if any
◆ gf_cache_get_content_length()
Get content length of resource
- Parameters
-
- Returns
- size of the content in bytes
◆ gf_cache_get_http_headers()
Get directives headers associated with the cache
- Parameters
-
entry | The entry of cache to use |
etag | set to etag value or NULL if no cache |
last_modif | set to last modif value or NULL if no cache |
- Returns
- GF_OK if everything went fine, GF_BAD_PARAM if parameters are wrong
◆ gf_cache_get_size()
u64 gf_cache_get_size |
( |
const char * |
directory | ) |
|
Computes the size of the cache elements in directory
- Parameters
-
directory | containing cache files |
- Returns
- size in bytes
◆ gf_cache_delete_all_cached_files()
GF_Err gf_cache_delete_all_cached_files |
( |
const char * |
directory | ) |
|
Delete all cached files in given directory starting with startpattern
- Parameters
-
- Returns
- GF_OK if everything went fine
◆ gf_cache_check_if_cache_file_is_corrupted()
Check if a given cache entry is corrupted (incomplete)
- Parameters
-
- Returns
- GF_TRUE if resource is corrupted
◆ gf_cache_entry_set_delete_files_when_deleted()
Mark associated files as "to be deleted" when the cache entry is removed
- Parameters
-
◆ gf_cache_entry_is_delete_files_when_deleted()
Check if associated files is marked as "to be deleted" when the cache entry is removed
- Parameters
-
- Returns
- GF_TRUE if cache entry is flaged as "to be deleted"
◆ gf_cache_get_sessions_count_for_cache_entry()
Get the number of sessions for a cache entry
- Parameters
-
- Returns
- the number of sessions using this cache entry
◆ gf_cache_get_start_range()
Get the start range of a cache entry
- Parameters
-
- Returns
- the start range in bytes
◆ gf_cache_get_end_range()
Get the end range of a cache entry
- Parameters
-
- Returns
- the end range in bytes
◆ gf_cache_are_headers_processed()
Check if the entry is marked as "headers processed" (reply headers have been parsed)
- Parameters
-
- Returns
- GF_TRUE if the entry is marked
◆ gf_cache_set_headers_processed()
Mark the entry as "headers processed"
- Parameters
-
- Returns
- error if any