SO, Ich versuche Caching für meine MVC5-Anwendung zu Optimierungszwecken zu konfigurieren. Obwohl ich OutputCache
Attribut auf eine Controller-Action-Methode gesetzt habe, kann ich meine Bilder nicht im Cache sehen. Hier ist die Controller-Aktion:Warum werden meine Bilder nicht zwischengespeichert, obwohl ich OUTPUTCACHE konfiguriert habe?
[OutputCache(Duration = 60, Location = OutputCacheLocation.ServerAndClient, NoStore=true, VaryByParam = "resultid")]
public FileContentResult getPicture(string resultid)
{
var actionLinks = db.ActionLinks.ToList();
var actionLinkPic = actionLinks.FirstOrDefault(p => p.Id == resultid);
if (actionLinks != null)
{
return File(actionLinkPic.TPicture, actionLinkPic.TPictureMimeType);
}
else
{
return null;
}
}
Hier ist die Netzwerk-Antwort in Firefox:
Das Netzwerk Antwort:
Versuchen Sie, 'NoStore = true' zu löschen –
Das wird diese Bilder dauerhaft speichern, ich will das nicht – Newbie