Пример #1
0
        public void PurgeCache(string storePath, string urlWithoutHash)
        {
            var deleteTargetPath = Path.Combine(storePath, GenerateFolderAndFilePath(urlWithoutHash, string.Empty, storePath).url);

            var filePaths = filePersist.FileNamesInDomain(deleteTargetPath);

            if (filePaths.Any())
            {
                // remove from hard cache.
                filePersist.DeleteByDomain(deleteTargetPath);

                // remove from on memory cache.
                var filePath = Path.Combine(deleteTargetPath, Path.GetFileName(filePaths[0]));
                if (pathObjectCache.ContainsKey(filePath))
                {
                    pathObjectCache.Remove(filePath);
                }
            }
        }