![]() |
![]() |
![]() |
libsoup Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties |
#include <libsoup/soup.h> struct SoupCache; enum SoupCacheType; SoupCache * soup_cache_new (const char *cache_dir
,SoupCacheType cache_type
); void soup_cache_flush (SoupCache *cache
); void soup_cache_clear (SoupCache *cache
); void soup_cache_dump (SoupCache *cache
); void soup_cache_load (SoupCache *cache
); guint soup_cache_get_max_size (SoupCache *cache
); void soup_cache_set_max_size (SoupCache *cache
,guint max_size
);
"cache-dir" gchar* : Read / Write / Construct Only "cache-type" SoupCacheType : Read / Write / Construct Only
typedef enum { SOUP_CACHE_SINGLE_USER, SOUP_CACHE_SHARED } SoupCacheType;
The type of cache; this affects what kinds of responses will be saved.
Since 2.34
SoupCache * soup_cache_new (const char *cache_dir
,SoupCacheType cache_type
);
Creates a new SoupCache.
|
the directory to store the cached data, or NULL to use the default one |
|
the SoupCacheType of the cache |
Returns : |
a new SoupCache |
Since 2.34
void soup_cache_flush (SoupCache *cache
);
This function will force all pending writes in the cache
to be
committed to disk. For doing so it will iterate the GMainContext
associated with cache
's session as long as needed.
Contrast with soup_cache_dump()
, which writes out the cache index
file.
|
a SoupCache |
Since 2.34
void soup_cache_clear (SoupCache *cache
);
Will remove all entries in the cache
plus all the cache files.
|
a SoupCache |
Since 2.34
void soup_cache_dump (SoupCache *cache
);
Synchronously writes the cache index out to disk. Contrast with
soup_cache_flush()
, which writes pending cache
entries to disk.
You must call this before exiting if you want your cache data to persist between sessions.
|
a SoupCache |
Since 2.34.
void soup_cache_load (SoupCache *cache
);
Loads the contents of cache
's index into memory.
|
a SoupCache |
Since 2.34
guint soup_cache_get_max_size (SoupCache *cache
);
Gets the maximum size of the cache.
|
a SoupCache |
Returns : |
the maximum size of the cache, in bytes. |
Since 2.34
"cache-dir"
property"cache-dir" gchar* : Read / Write / Construct Only
The directory to store the cache files.
Default value: NULL
"cache-type"
property"cache-type" SoupCacheType : Read / Write / Construct Only
Whether the cache is private or shared.
Default value: SOUP_CACHE_SINGLE_USER