Soup.Cache¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
The directory to store the cache files |
||
r/w/co |
Whether the cache is private or shared |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Soup.Cache(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(cache_dir, cache_type)¶
- Parameters:
cache_dir (
str
orNone
) – the directory to store the cached data, orNone
to use the default one. Note that since the cache isn’t safe to access for multiple processes at once, and the default directory isn’t namespaced by process, clients are strongly discouraged from passingNone
.cache_type (
Soup.CacheType
) – theSoup.CacheType
of the cache
- Returns:
a new
Soup.Cache
- Return type:
Creates a new
Soup.Cache
.New in version 2.34.
- clear()¶
Will remove all entries in the self plus all the cache files.
New in version 2.34.
- dump()¶
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.
New in version 2.34..
- flush()¶
This function will force all pending writes in the self to be committed to disk. For doing so it will iterate the
GLib.MainContext
associated with self's session as long as needed.Contrast with
Soup.Cache.dump
(), which writes out the cache index file.New in version 2.34.
- get_max_size()¶
- Returns:
the maximum size of the cache, in bytes.
- Return type:
Gets the maximum size of the cache.
New in version 2.34.
- load()¶
Loads the contents of self's index into memory.
New in version 2.34.
- set_max_size(max_size)¶
- Parameters:
max_size (
int
) – the maximum size of the cache, in bytes
Sets the maximum size of the cache.
New in version 2.34.
- do_get_cacheability(msg) virtual¶
- Parameters:
msg (
Soup.Message
) –- Return type:
Property Details¶
- Soup.Cache.props.cache_dir¶
- Name:
cache-dir
- Type:
- Default Value:
- Flags:
The directory to store the cache files
- Soup.Cache.props.cache_type¶
- Name:
cache-type
- Type:
- Default Value:
- Flags:
Whether the cache is private or shared