Last post Dec 23, 2020 11:32 AM by mywatermelon
Member
53 Points
246 Posts
Dec 23, 2020 10:11 AM|mywatermelon|LINK
I have an existed project made by asp.net core 5.
Now I need to add ETag(https://en.wikipedia.org/wiki/HTTP_ETag) to it for SEO(ETag works for sitemap and page).
How can I achieve this? Thank you.
Dec 23, 2020 11:32 AM|mywatermelon|LINK
I found an easy way soon:
Install a Nuget package Marvin.Cache.Headers
Add this in ConfigureServices:
services.AddHttpCacheHeaders();
And add this in Configure:
app.UseHttpCacheHeaders();
And then the ETag will work automatically.
Member
53 Points
246 Posts
How can I add ETag in asp.net core 5?
Dec 23, 2020 10:11 AM|mywatermelon|LINK
I have an existed project made by asp.net core 5.
Now I need to add ETag(https://en.wikipedia.org/wiki/HTTP_ETag) to it for SEO(ETag works for sitemap and page).
How can I achieve this? Thank you.
Member
53 Points
246 Posts
Re: How can I add ETag in asp.net core 5?
Dec 23, 2020 11:32 AM|mywatermelon|LINK
I found an easy way soon:
Install a Nuget package Marvin.Cache.Headers
Add this in ConfigureServices:
services.AddHttpCacheHeaders();
And add this in Configure:
app.UseHttpCacheHeaders();
And then the ETag will work automatically.