public bool BeforeExecute(IOperation operation)
        {
            _proxy = operation.FindAttribute<CacheProxyAttribute>();
            _browser = operation.FindAttribute<CacheBrowserAttribute>();
            _server = operation.FindAttribute<CacheServerAttribute>();

            var cacheEntry = TryGetValidCacheEntry(_request.Uri.AbsolutePath);

            if (cacheEntry != null)
            {
                _cachedValue = cacheEntry.Value;
            }
            return true;
        }
Ejemplo n.º 2
0
        public static ResponseCachingState GetResponseDirective(
            CacheProxyAttribute proxy,
            CacheBrowserAttribute browser,
            CacheServerAttribute server)
        {
            ValidateProxyAttribute(proxy);

            var instructions = CacheVisibility(proxy, browser)
                .Concat(CacheRevalidation(proxy, browser))
                .Concat(CacheMaxAge(proxy, browser));

            var response = new ResponseCachingState(instructions);

            // SetupLocalCaching(proxy, response);

            return response;
        }