Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi All,
I have played around with this most the day. I have seen a few other forum posts talking about how to enable static asset caching.
app.UseStaticFiles(new StaticFileOptions { OnPrepareResponse = ctx => { const int durationInSeconds = 60 * 60 * 24; ctx.Context.Response.Headers[HeaderNames.CacheControl] = "public,max-age=" + durationInSeconds; } });
I have tried everything and it just does not seem to be cachign whatever I do or wherever I put the app.UseStaticFiles
Has anyone got this working? And can you send me a copy of your startup.cs file so I can compare this with mine.
As you can see in the screenshot the images are just not flagging up as cached.
yes, we didm you can use our package https://www.dyfort.com/products/umbraco-static-files/, I'll try to push code to gihub later
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Umbraco 10-12 app.UseStaticFiles() does nothing
Hi All,
I have played around with this most the day. I have seen a few other forum posts talking about how to enable static asset caching.
I have tried everything and it just does not seem to be cachign whatever I do or wherever I put the app.UseStaticFiles
Has anyone got this working? And can you send me a copy of your startup.cs file so I can compare this with mine.
As you can see in the screenshot the images are just not flagging up as cached.
yes, we didm you can use our package https://www.dyfort.com/products/umbraco-static-files/, I'll try to push code to gihub later
is working on a reply...