What events are executed / not fired when the page is returned from the asp.net cache?

I have an application that users need to log into. Once logged in, they can search our database.

Their identification can affect search results.

I want to use Cache pages for results. VaryByParam sounds good for this.

However, I don't understand the events that fire or don't fire when the cached version of the page is returned.

I don't want another user to try to feed url parameters that might point to a different user account and thus allow them to access the results of any results.

So I need a server event that always fires even when the page is returned from the cache, so I can check this ID parameter against the session version of the same.

However, this also means that I cannot perform my search on this event, as it will always work and therefore defeat the purpose of caching. So I need another event that only fires if the page is not fetched from the cache.

What events are executed under these two sets of circumstances?

0


source to share


1 answer


Have you considered setting the response cache properties so that the client machine can cache the result? Use the SetCacheability method of the Cache policy to respond to caching Private .



You don't need server caching if each user can have different results in order for the client cache to get the job done.

+1


source







All Articles