P
Pete Davis
First of all, I apologize. I wanted to post this in
microsoft.public.dotnet.framework (as it's a bit more appropriate there),
but Outlook Express is suddenly giving me errors whenever I go to that
newsgroup and I have to restart OE.
I'm using WebRequest and I want to bypass any caching in the proxy server.
Unfortunately, I don't have a proxy to test with.
My understanding is that I just need to pass a pragma: no-cache and
cache-control: no-cache (to avoid caching in the first place) in the header.
Do I simply add the headers as shown in the code below? Or do I need to do
something else?
WebRequest req = WebRequest.Create(url);
if (null != proxy)
{
req.Proxy = proxy;
}
using (WebResponse response = req.GetResponse())
{
req.Headers.Add("pragma", "no-cache");
req.Headers.Add("cache-control", "no-cache");
using (Stream stream = response.GetResponseStream())
{...
Thanks.
Pete
microsoft.public.dotnet.framework (as it's a bit more appropriate there),
but Outlook Express is suddenly giving me errors whenever I go to that
newsgroup and I have to restart OE.
I'm using WebRequest and I want to bypass any caching in the proxy server.
Unfortunately, I don't have a proxy to test with.
My understanding is that I just need to pass a pragma: no-cache and
cache-control: no-cache (to avoid caching in the first place) in the header.
Do I simply add the headers as shown in the code below? Or do I need to do
something else?
WebRequest req = WebRequest.Create(url);
if (null != proxy)
{
req.Proxy = proxy;
}
using (WebResponse response = req.GetResponse())
{
req.Headers.Add("pragma", "no-cache");
req.Headers.Add("cache-control", "no-cache");
using (Stream stream = response.GetResponseStream())
{...
Thanks.
Pete