caching - C# - Why is my HTTPWebRequest returning a cached response every time? -


i've seen various similar questions this, nothing has helped solve issue. here's code fragment i'm working:

networkcredential credentials = new networkcredential(credentialsmanager.username, credentialsmanager.password);  httpwebrequest getreq = (httpwebrequest) webrequest.create(m_editpageurl); getreq.cachepolicy = new requestcachepolicy(requestcachelevel.bypasscache); // i've tried requestcachelevel.nocachenostore getreq.credentials = credentials; getreq.timeout = 1000; getreq.method = "get"; getreq.accept = "text/html";  string responsestring; using (httpwebresponse getresponse = (httpwebresponse) getreq.getresponse()) {     using (stream responsestream = getresponse.getresponsestream())     {         if (responsestream == null)             throw new exception("did not receive response specified page.");          using (streamreader reader = new streamreader(responsestream))             responsestring = reader.readtoend();     } } 

for reason, whatever gets stored responsestring being cached, though i've told httpwebrequest bypass cache. every hour, newer response, if change anything, newer response (which should invalidated since there's newer version) still passed me. i've been told on authority server set not cache responses, must doing wrong. can't figure out what.

i read somewhere may make more low-level loader using sockets. however, couldn't find anywhere showed how this. if should do, please let me know find on that.

thanks.

while doing digging in code site hosted on server application accesses, found out site has cache service maintains. once disabled, ran charm. original code works fine.


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -