The page will expire using outputcache varybyparam = "*" at a specific time
1 answer
You can calculate the number of seconds until midnight each time the page loads, and then programmatically set the duration with Response.Cache.SetExpires
. I've never done this, but I don't understand why it won't work.
Obviously it's midnight on the server, you probably don't know what time of day it is on the client.
EDIT. Actually looking at the definition SetExpires
it takes DateTime
, not the duration, so you don't even need to calculate the number of seconds, just pass it regardless DateTime
at the next midnight.
+3
a source to share