We are currently developing a WSE 3.0 service for User Management.
To increase performance we would like to cache certain objects. But the
session object is always null inside of WSE.
We can use the HttpContext.Current.Cache object and it seems to work, but
here are my concerns:
Is this cache global across all calls to the wse service. This is important
because some items in the cache we remove and they need to be removed for
everyone.
Second, we would like to setup this service on 2 apps service and load
balance them. The cache obviously can't be shared across 2 machines. If we
could use the session we could use a session server.
Pablo Cibraro [MVP] - 18 Oct 2006 15:29 GMT
Hi Mike,
First of all, the Cache is shared between all the web services configured in
the same web application and same machine.
If you are trying to use the session in a WSE filter or token manager, it
could be null because WSE runs before than the ASP.NET session module (Or
you are trying to use the Session in a web service hosted outside of the
ASP.NET worker process, for instance, a windows console). Anyway, the
purpose of the session is completely different, it does not support
different expiration rules as the cache does.
You can also try with the Enterprise Library Caching application block.
Regards,
Pablo Cibraro.
As you said, you can use a session server to share session information in
a web farm scenario, but the purpose of the session is completely different
from the purpose of the cache. (The cache supports
> We are currently developing a WSE 3.0 service for User Management.
>
[quoted text clipped - 13 lines]
> we
> could use the session we could use a session server.
Michael Primeaux - 19 Oct 2006 02:11 GMT
Hi Mike,
The System.Web.Caching.Cache (accessed via HttpContext.Cache.Current) is a
process-wide cache. Therefore the cache is "global" to across calls to the
WSE service for the same machine (assuming you're executing the web service
within the same app pool). I say this because it possible to create multiple
instances of the web service each running under a different app pool.
However, the latter deployment scenario isn't a usual configuration.
I'm still unclear as to whether you require session or cache as their
consumer API surface design goals are entirely different. Would you please
tell me a bit more about your scenario?
Kindest regards,
Michael
> We are currently developing a WSE 3.0 service for User Management.
>
[quoted text clipped - 13 lines]
> we
> could use the session we could use a session server.