Windows server and cache problems?

  • Thread starter Thread starter Supremelink
  • Start date Start date
S

Supremelink

Hi all,

I have a (in my opinion) strange problem. I created an application
that are extracting exchange rates from a web page and then inserts
those in a ms sql database.

When I´m running this application on my local machine, everything
works fine. All rates are updated. But when I run it on the server, it
´s always gets the same result. No update at all. It´s like the result
are cached or something.

Does anyone have any idea about this?

Cheers!

/Marre
 
Hello, Supremelink!

Are you sure that content from the web page gets downloaded by your
application?
How do you retrieve web page content? Can you throw in some code?

Are there any proxies between your local computer and web server. Or between
work server and web server.?

--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com

You wrote on Tue, 11 Sep 2007 03:19:45 -0700:

S> Hi all,

S> I have a (in my opinion) strange problem. I created an application
S> that are extracting exchange rates from a web page and then inserts
S> those in a ms sql database.

S> When I´m running this application on my local machine, everything
S> works fine. All rates are updated. But when I run it on the server,
S> it ´s always gets the same result. No update at all. It´s like the
S> result are cached or something.

S> Does anyone have any idea about this?

S> Cheers!

S> /Marre
 
Hi Vadym,

The strange thing here is that it works on my local computer.

I´m reading the page as a string and then just extracts the rates. Here
´s some code:

HttpWebRequest request =
(HttpWebRequest)WebRequest.Create(currentUrl);

string proxyUrl=ConfigurationManager.AppSettings["ProxyServer"];
if (null == proxyUrl || proxyUrl.Length == 0)
{
log.Info("WebRates::readContent() Not using proxy server");
}
else
{
log.Info(String.Format("WebRates::readContent() Using proxy
server: {0}", proxyUrl));
WebProxy proxy = new WebProxy(proxyUrl, true);
request.Proxy=proxy;
}

response = request.GetResponse();
stream = response.GetResponseStream();
reader = new StreamReader(stream);

content = reader.ReadToEnd();

log.Info(String.Format("WebRates::readContent() Content read
successfully, number of characters read: {0}", content.Length));
return true;

I´m extracting exchange rates from content.

I think it might be a proxy server between. Does that have any impact
on this?

Thanks for youre answer!

Regards
Martin
 
Hello, Supremelink!

Yes, proxies can impact data received by you.
You can try to specify additional header , Pragma: no-cache, where "pragma"
is header name and "no-cache" is header value.
--
With best regards, Vadym Stetsiak.
Blog: http://vadmyst.blogspot.com

You wrote on Mon, 01 Oct 2007 01:34:46 -0700:

S> Hi Vadym,

S> The strange thing here is that it works on my local computer.

S> I´m reading the page as a string and then just extracts the rates.
S> Here ´s some code:

S> HttpWebRequest request =
S> (HttpWebRequest)WebRequest.Create(currentUrl);

S> string proxyUrl=ConfigurationManager.AppSettings["ProxyServer"];
S> if (null == proxyUrl || proxyUrl.Length == 0)
S> {
S> log.Info("WebRates::readContent() Not using proxy server");
S> }
S> else
S> {
S> log.Info(String.Format("WebRates::readContent() Using proxy
S> server: {0}", proxyUrl));
S> WebProxy proxy = new WebProxy(proxyUrl, true);
S> request.Proxy=proxy;
S> }

S> response = request.GetResponse();
S> stream = response.GetResponseStream();
S> reader = new StreamReader(stream);

S> content = reader.ReadToEnd();

S> log.Info(String.Format("WebRates::readContent() Content read
S> successfully, number of characters read: {0}", content.Length));
S> return true;

S> I´m extracting exchange rates from content.

S> I think it might be a proxy server between. Does that have any impact
S> on this?

S> Thanks for youre answer!

S> Regards
S> Martin




S>>> Hi all,

S>>> I have a (in my opinion) strange problem. I created an application
S>>> that are extracting exchange rates from a web page and then inserts
S>>> those in a ms sql database.

S>>> When I´m running this application on my local machine, everything
S>>> works fine. All rates are updated. But when I run it on the server,
S>>> it ´s always gets the same result. No update at all. It´s like the
S>>> result are cached or something.

S>>> Does anyone have any idea about this?

S>>> Cheers!

S>>> /Marre



S>>> Hi all,

S>>> I have a (in my opinion) strange problem. I created an application
S>>> that are extracting exchange rates from a web page and then inserts
S>>> those in a ms sql database.

S>>> When I´m running this application on my local machine, everything
S>>> works fine. All rates are updated. But when I run it on the server,
S>>> it ´s always gets the same result. No update at all. It´s like the
S>>> result are cached or something.

S>>> Does anyone have any idea about this?

S>>> Cheers!

S>>> /Marre
 
Hi Vadym

Thanks a lot! I will try this and leave you a message regarding the
progress.

Cheers!
/Martin
 
Back
Top