Ejemplo n.º 1
0
 public void on_proxy_only()
 {
     CacheResponse.GetResponseDirective(new CacheProxyAttribute {
         MustRevalidateWhenStale = true
     })
     .CacheDirectives.ShouldContain("must-revalidate");
 }
Ejemplo n.º 2
0
 public void on_proxy_not_on_client()
 {
     CacheResponse.GetResponseDirective(
         new CacheProxyAttribute {
         MustRevalidateWhenStale = true
     },
         new CacheClientAttribute {
         MustRevalidateWhenStale = false
     })
     .CacheDirectives.ShouldContain("proxy-revalidate");
 }
Ejemplo n.º 3
0
 protected void when_getting_response_caching()
 {
     try
     {
         cache = CacheResponse.GetResponseDirective(_proxy, client);
     }
     catch (Exception e)
     {
         exception = e;
     }
 }
        public Func <IOperationAsync, Task <IEnumerable <OutputMember> > > Compose(
            Func <IOperationAsync, Task <IEnumerable <OutputMember> > > next)
        {
            return(async operation =>
            {
                var outputMembers = await next(operation);

                _proxy = operation.FindAttribute <CacheProxyAttribute>();
                _client = operation.FindAttribute <CacheClientAttribute>();

                _data[CacheKeys.ResponseCache] = CacheResponse.GetResponseDirective(_proxy, _client);
                return outputMembers;
            });
        }