Skip to content

Commit b686bea

Browse files
authored
updated cache headers
1 parent 48ac23a commit b686bea

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ private void DoValidationByLocalEventConfig()
144144
if (validationResult.DoRedirect)
145145
{
146146
//Adding no cache headers to prevent browsers to cache requests
147-
Response.Cache.SetCacheability(HttpCacheability.NoCache);
148-
Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
149-
Response.Cache.SetNoStore();
147+
context.Response.Headers.Add("Cache-Control", "no-cache, no-store, must-revalidate, max-age=0");
148+
context.Response.Headers.Add("Pragma", "no-cache");
149+
context.Response.Headers.Add("Expires", "Fri, 01 Jan 1990 00:00:00 GMT");
150150
//end
151151
//Send the user to the queue - either becuase hash was missing or becuase is was invalid
152152
Response.Redirect(validationResult.RedirectUrl,false);
@@ -214,9 +214,9 @@ private void DoValidation()
214214
if (validationResult.DoRedirect)
215215
{
216216
//Adding no cache headers to prevent browsers to cache requests
217-
Response.Cache.SetCacheability(HttpCacheability.NoCache);
218-
Response.Cache.SetExpires(DateTime.UtcNow.AddHours(-1));
219-
Response.Cache.SetNoStore();
217+
context.Response.Headers.Add("Cache-Control", "no-cache, no-store, must-revalidate, max-age=0");
218+
context.Response.Headers.Add("Pragma", "no-cache");
219+
context.Response.Headers.Add("Expires", "Fri, 01 Jan 1990 00:00:00 GMT");
220220
//end
221221
222222
if (validationResult.IsAjaxResult)

0 commit comments

Comments
 (0)