6 references to CacheOutput
OutputCachingSample (6)
Startup.cs (6)
26
app.MapGet("/nocache", Gravatar.WriteGravatar).
CacheOutput
(x => x.NoCache());
32
var blog = app.MapGroup("blog").
CacheOutput
(x => x.Tag("blog"));
34
blog.MapGet("/post/{id}", Gravatar.WriteGravatar).
CacheOutput
(x => x.Tag("blog", "byid")); // Calling CacheOutput() here overwrites the group's policy
44
app.MapGet("/query", Gravatar.WriteGravatar).
CacheOutput
(p => p.SetVaryByQuery("culture"));
46
app.MapGet("/vary", Gravatar.WriteGravatar).
CacheOutput
(c => c.VaryByValue((context) => new KeyValuePair<string, string>("time", (DateTime.Now.Second % 2).ToString(CultureInfo.InvariantCulture))));
55
}).
CacheOutput
(p => p.SetLocking(false).Expire(TimeSpan.FromMilliseconds(1)));