WebCache/WebCache.cs
/// <summary>
/// Gets resource from the cache.
/// </summary>
/// <param name="url">URL.</param>
/// <returns>Byte array.</returns>
Gets resource from the cache.
Gets resource from the cache .
protected byte[] GetResourceFromCache(string url)
        {
            byte[] binary = null;
            var cachePath = GetCachedFilePath(url);
            if (File.Exists(cachePath))
            {
                try
                {
                    binary = File.ReadAllBytes(cachePath);
                }
                catch (Exception ex)
                {
                    logger?.LogWarning(ex, $"Cannot read '{cachePath}' from cache.");
                }
            }
            return binary;
        }
protected byte [ ] GetResourceFromCache ( string url ) { byte [ ] binary = null ; var cachePath = GetCachedFilePath ( url ) ; if ( File . Exists ( cachePath ) ) { try { binary = File . ReadAllBytes ( cachePath ) ; } catch ( Exception ex ) { logger ? . LogWarning ( ex , $" Cannot read ' { cachePath } ' from cache. " ) ; } } return binary ; }
Gets resource from the cache.
Gets resource from the cache .
None
url
string
None