I want to add to the cache, there is better than my way? #1499

Closed
opened 2025-08-09 17:20:22 +00:00 by fergalmoran · 0 comments
Owner

Originally created by @wspnet on 7/19/2016

Response.Headers.Add("Last-Modified", DateTime.Now.ToString("U", DateTimeFormatInfo.InvariantInfo)); DateTime IfModifiedSince; if (DateTime.TryParse(Request.Headers["If-Modified-Since"], out IfModifiedSince)) { if ((DateTime.Now - IfModifiedSince.AddHours(8)).Seconds < 10) { Response.StatusCode = 304; } }

I want to add to the cache, there is better than my way? I hope it is permanent in nature cached on the client, and the same access to the general characteristics of the image

[ResponseCache(Duration = 60 * 60 * 24 * 365, Location = ResponseCacheLocation.Any)] [Route("resize_{maxWidth}_{maxHeight}/{*imagePath}")] public async Task Index(string imagePath, int maxWidth, int maxHeight) {

I did not see the cache Status 304

*Originally created by @wspnet on 7/19/2016* `Response.Headers.Add("Last-Modified", DateTime.Now.ToString("U", DateTimeFormatInfo.InvariantInfo)); DateTime IfModifiedSince; if (DateTime.TryParse(Request.Headers["If-Modified-Since"], out IfModifiedSince)) { if ((DateTime.Now - IfModifiedSince.AddHours(8)).Seconds < 10) { Response.StatusCode = 304; } }` I want to add to the cache, there is better than my way? I hope it is permanent in nature cached on the client, and the same access to the general characteristics of the image [ResponseCache(Duration = 60 \* 60 \* 24 \* 365, Location = ResponseCacheLocation.Any)] [Route("resize_{maxWidth}_{maxHeight}/{*imagePath}")] public async Task<IActionResult> Index(string imagePath, int maxWidth, int maxHeight) { I did not see the cache Status 304
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/JavaScriptServices#1499
No description provided.