3using System.Threading.Tasks;
12 [DefaultImplementation(typeof(InternetCacheService))]
20 Task<(
byte[]? Data,
string ContentType)>
TryGet(Uri Uri);
29 Task<(
byte[]? Data,
string ContentType)>
GetOrFetch(Uri Uri,
string ParentId,
bool Permanent);
39 Task<(
byte[]? Data,
string ContentType)>
GetOrFetch(Uri Uri,
string ParentId,
bool Permanent, TimeSpan Timeout);
Defines operations for caching arbitrary internet-fetchable content.
Task MakeTemporary(string ParentId)
Marks items in the cache with the given parent ID as temporary.
Task<(byte[]? Data, string ContentType)> GetOrFetch(Uri Uri, string ParentId, bool Permanent)
Retrieves content for the specified URI from cache or fetches and caches it if missing.
Task<(byte[]? Data, string ContentType)> TryGet(Uri Uri)
Tries to retrieve a cached blob for the specified URI.
Task< bool > Remove(Uri Uri)
Removes the cached entry for the specified URI, if it exists.
Task MakePermanent(string ParentId)
Marks items in the cache with the given parent ID as permanent.
Task< int > RemoveByParentId(string ParentId)
Removes all cached entries having the specified parent ID.
Task<(byte[]? Data, string ContentType)> GetOrFetch(Uri Uri, string ParentId, bool Permanent, TimeSpan Timeout)
Retrieves content for the specified URI from cache or fetches and caches it if missing,...
A service that can be loaded and unloaded at will. Typically during startup and shutdown of an applic...