nsISupports
Last changed in Gecko 2.0 (Firefox 4 / Thunderbird 3.3 / SeaMonkey 2.1)Note: Starting in Gecko 2.0, cache I/O is handled asynchronously.
Method overview
nsICacheSession createSession(in string clientID, in nsCacheStoragePolicy storagePolicy, in boolean streamBased); |
ACString createTemporaryClientID(in nsCacheStoragePolicy storagePolicy); Obsolete since Gecko 1.9.2 |
void evictEntries(in nsCacheStoragePolicy storagePolicy); |
void init(); Obsolete since Gecko 1.8 |
void shutdown(); Obsolete since Gecko 1.8 |
void visitEntries(in nsICacheVisitor visitor); |
Attributes
Attribute | Type | Description |
cacheIOTarget |
nsIEventTarget |
The event target for cache I/O operation notifications. Read only. |
Methods
createSession()
This method creates a cache session.
A cache session represents a client's access into the cache. The cache session is not "owned" by the cache service. Hence, it is possible to create duplicate cache sessions. Entries created by a cache session are invisible to other cache sessions, unless the cache sessions are equivalent.
nsICacheSession createSession( in string clientID, in nsCacheStoragePolicy storagePolicy, in boolean streamBased );
Parameters
-
clientID
- Specifies the name of the client using the cache.
-
storagePolicy
- Limits the storage policy for all entries accessed via the returned session. As a result, devices excluded by the storage policy will not be searched when opening entries from the returned session.
-
streamBased
-
Indicates whether or not the data being cached can be represented as a stream. The
storagePolicy
must be consistent with the value of this field. For example, a non-stream-based cache entry can only have a storage policy ofSTORE_IN_MEMORY
.
Return value
Returns a new cache session.
createTemporaryClientID()
Deprecated
This feature has been removed from the Web. Though some browsers may still support it, it is in the process of being dropped. Do not use it in old or new projects. Pages or Web apps using it may break at any time.
Obsolete since Gecko 1.9.2 (Firefox 3.6 / Thunderbird 3.1 / Fennec 1.0)
This feature is obsolete. Although it may still work in some browsers, its use is discouraged since it could be removed at any time. Try to avoid using it.
This method creates and returns a unique, temporary cache client ID.
This is used by the offline cache. The offline cache lets clients accumulate entries in a temporary client and merge them in as a group using nsIOfflineCacheSession.mergeTemporaryClient()
.
ACString createTemporaryClientID( in nsCacheStoragePolicy storagePolicy );
Parameters
-
storagePolicy
- The cache storage policy.
Return value
Returns a newly created unique, temporary cache client ID.
Exceptions thrown
-
NS_ERROR_NOT_IMPLEMENTED
- This method is deprecated.
evictEntries()
This method evicts all entries in all devices implied by the storage policy.
void evictEntries( in nsCacheStoragePolicy storagePolicy );
Parameters
-
storagePolicy
- The cache storage policy.
init()
Initialize the cache service.
void init();
Parameters
None.
Exceptions thrown
-
Missing Exception
- Missing Description
shutdown()
Shutdown()
the cache service.
void shutdown();
Parameters
None.
visitEntries()
This method visits entries stored in the cache. Used to implement the about:cache
URI.
void visitEntries( in nsICacheVisitor visitor );
Parameters
-
visitor
- The entry to be visited.