Exemple #1
0
        public static UrlCache CreateIndexedCache(string directory, UrlFileNameType urlFileNameType = UrlFileNameType.Host | UrlFileNameType.Path | UrlFileNameType.Ext | UrlFileNameType.Query)
        {
            if (directory == null)
            {
                return(null);
            }
            UrlCache urlCache = new UrlCache(directory);

            urlCache._urlFileNameType = urlFileNameType;
            urlCache._indexedFile     = true;
            urlCache._saveRequest     = true;
            return(urlCache);
        }
Exemple #2
0
        //private string _GetUrlSubDirectory(HttpRequest httpRequest)
        //{
        //    if (_getUrlSubDirectory != null)
        //        return _getUrlSubDirectory(httpRequest);
        //    else
        //        return null;
        //}

        //private string GetUrlFilename(HttpRequest httpRequest)
        //{
        //    return zurl.UrlToFileName(httpRequest, _urlFileNameType);
        //}

        public static UrlCache Create(XElement xe)
        {
            if (xe != null && xe.zXPathValue("UseUrlCache").zTryParseAs(false))
            {
                UrlCache urlCache = new UrlCache(xe.zXPathExplicitValue("CacheDirectory"));
                urlCache._urlFileNameType = zurl.GetUrlFileNameType(xe.zXPathValue("CacheUrlFileNameType", "Path"));
                urlCache._indexedFile     = xe.zXPathValue("IndexedFile").zTryParseAs(false);
                urlCache._saveRequest     = xe.zXPathValue("CacheSaveRequest").zTryParseAs(false);
                return(urlCache);
            }
            else
            {
                return(null);
            }
        }
Exemple #3
0
        //public HttpManager_v3 HttpManager { get { return _httpManager; } set { _httpManager = value; } }
        //public UrlCache UrlCache { get { return _urlCache; } set { _urlCache = value; } }

        public HttpCacheManager(HttpManager_v5 httpManager, UrlCache urlCache)
        {
            _httpManager = httpManager;
            _urlCache    = urlCache;
        }
Exemple #4
0
 public void SetCacheManager(UrlCache urlCache)
 {
     _httpCacheManager = new HttpCacheManager(this, urlCache);
 }