예제 #1
0
 public static void AsCacheable(this HttpContext ctx, TimeSpan span, string customHeader = null) => ctx.AddResponseExpirationHeader(span, customHeader);
예제 #2
0
    public static void AsCacheable(this HttpContext ctx, DateTime absoluteExpiration, string customHeader = null)
    {
        var span = absoluteExpiration - DateTime.UtcNow;

        ctx.AddResponseExpirationHeader(span, customHeader);
    }
예제 #3
0
    public static void AsCacheable(this HttpContext ctx, int seconds, string customHeader = null)
    {
        var span = TimeSpan.FromSeconds(seconds);

        ctx.AddResponseExpirationHeader(span, customHeader);
    }