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

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

        ctx.AddResponseExpirationHeader(span, customHeader);
    }