Clear ASP.NET OutputCache via Web Applications

Is it possible to clear the output cache of one asp.net web app from another asp.net web app?

Reason ... We have several wep applications structured as ...

Pages in / area1 / and / area2 / are cached and managed via / intranet / cms /. When a page is edited using / intranet / cms / I want to clear it from the cache in the corresponding / area # / application.

I've already tried using VaryByCustom which looks at the manual stored in HttpContext.Cache, but it looks like it's cached per web app, which doesn't work.

Indeed, if there was any way to transfer data between web applications on the same server, this would solve my problem, since I can use this + VaryByCustom.

Thank!

-Mick Thomas

+2


source to share


2 answers


The way I have done this in the past is to have a "hidden" page (on each of the sites /areaX

) that does cleanup, reload, etc. The page checks the general secret request parameter before doing anything (to avoid DoS attacks). If a valid page displays "OK" after completing the operation; generates a 404 error if the secret is not valid.

If you want flash to be enabled per item or per group, add a second parameter that identifies that item / group.



This method is also independent of the server technology and can be invoked by other management tools as needed.

+3


source


One way that I know is to use a share as a dependency, usually a file. When the file is changed, the cache is cleared. I think you can use HttpResponse.AddFileDependency for this.



However, in these cases it is usually better to use an out-of-process cache such as memcached . I haven't tested it myself, but the link is for using memcached with OutputCache.

+2


source







All Articles