Xamarin.CustomCache 1.0.4

A Shared Xamarin component for Caching custom data on to disk

Install-Package Xamarin.CustomCache -Version 1.0.4
dotnet add package Xamarin.CustomCache --version 1.0.4
<PackageReference Include="Xamarin.CustomCache" Version="1.0.4" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Xamarin.CustomCache --version 1.0.4
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

CustomCache

A Shared Xamarin component for Caching custom data on to disk

Usage:

using Subsystems.Cache.External;
....
....
    private CMPCacheProxy _cacheProxy;

Initialize

    var cachedFolderPathString = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
    _cacheProxy = new CMPCacheProxy(cachedFolderPathString, <sizeLimitInKB>); // e.g. 5 * 1024

Expiry

    _cacheProxy.ExpiryDays(<Expiry_Days>); // Cache will invalidate after expiry from Creation or Last Update
    ....
    ....

    _cacheProxy.ExpiryDays(<Expiry_Days>);
  OR,
    _cacheProxy.ExpiryMonths(<Expiry_Months>);      
  OR,
    _cacheProxy.ExpiryYears(<Expiry_Years>);
  OR,
    _cacheProxy.ExpiryHours(<Expiry_Years>);
  OR,
    _cacheProxy.ExpiryMinutes(<Expiry_Minutes>);
  OR,
    _cacheProxy.ExpirySeconds(<Expiry_Seconds>);

Cache & Retrieve:

string cacheString = null;				
byte[] retrievedBytes = _cacheProxy.RetieveItem("testfile81");
if (retrievedBytes != null)
{
    cacheString = System.Text.Encoding.UTF8.GetString(retrievedBytes);
    Console.WriteLine("cacheString:" + cacheString);
}
else
{

    cacheString = "Test String38";
    byte[] cacheBytes = System.Text.Encoding.UTF8.GetBytes(cacheString);
    _cacheProxy.CacheItem(cacheBytes, "testfile81");

}

CustomCache

A Shared Xamarin component for Caching custom data on to disk

Usage:

using Subsystems.Cache.External;
....
....
    private CMPCacheProxy _cacheProxy;

Initialize

    var cachedFolderPathString = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
    _cacheProxy = new CMPCacheProxy(cachedFolderPathString, <sizeLimitInKB>); // e.g. 5 * 1024

Expiry

    _cacheProxy.ExpiryDays(<Expiry_Days>); // Cache will invalidate after expiry from Creation or Last Update
    ....
    ....

    _cacheProxy.ExpiryDays(<Expiry_Days>);
  OR,
    _cacheProxy.ExpiryMonths(<Expiry_Months>);      
  OR,
    _cacheProxy.ExpiryYears(<Expiry_Years>);
  OR,
    _cacheProxy.ExpiryHours(<Expiry_Years>);
  OR,
    _cacheProxy.ExpiryMinutes(<Expiry_Minutes>);
  OR,
    _cacheProxy.ExpirySeconds(<Expiry_Seconds>);

Cache & Retrieve:

string cacheString = null;				
byte[] retrievedBytes = _cacheProxy.RetieveItem("testfile81");
if (retrievedBytes != null)
{
    cacheString = System.Text.Encoding.UTF8.GetString(retrievedBytes);
    Console.WriteLine("cacheString:" + cacheString);
}
else
{

    cacheString = "Test String38";
    byte[] cacheBytes = System.Text.Encoding.UTF8.GetBytes(cacheString);
    _cacheProxy.CacheItem(cacheBytes, "testfile81");

}

Release Notes

Linked to CustomFileManager dependency
Issue fixes
Code refactoring

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.4 241 11/9/2018
1.0.3 139 10/22/2018
1.0.2 210 8/1/2018
1.0.1 165 8/1/2018
1.0.0 185 8/1/2018