Navigating with Webbrowser controll w/o using cache

I am using the webbrowser controll and I navigate to a few certain pages over and over again, my problem is, as of the second time I navigate to each page I am getting an ofline version (from cache)and not the up to date page.
How do I navigate ignoring previous cached pages?
Thanks in advance,
Who is Participating?
rkot2000Connect With a Mentor Commented:
try to declare with withevents statement.
I think you need to use this flag navNoHistory :
webcontrl.navigate url, myflag

Contains values used by the IWebBrowser2::Navigate and IWebBrowser2::Navigate2 methods.


typedef enum BrowserNavConstants {
    navOpenInNewWindow = 0x1,
    navNoHistory = 0x2,
    navNoReadFromCache = 0x4,
    navNoWriteToCache = 0x8,
    navAllowAutosearch = 0x10,
    navBrowserBar = 0x20,
    navHyperlink = 0x40
} BrowserNavConstants;


Open the resource or file in a new window.

Do not add the resource or file to the history list. The new page replaces the current page in the list.

Not currently supported.

Not currently supported.

If the navigation fails, the autosearch functionality attempts to navigate common root domains (.com, .edu, and so on). If this also fails, the URL is passed to a search engine.

Causes the current Explorer Bar to navigate to the given item, if possible.

If the navigation fails when a hyperlink is being followed, this constant specifies that the resource should then be bound to the moniker using the BINDF_HYPERLINK flag.

BenjyAuthor Commented:
No, That didn't do it.
It would make sence that the navNoReadFromCache is in place, but it is not supported. (I tried it and it indeed doesn't work)

Any suggestions?
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

if you have access to the page,
you can disable caching from the page.
BenjyAuthor Commented:
what do you mean?
in the asp page
or in the iis server you can set
expiration date or just disable page caching

<%@ Language=VBScript %>
          Option Explicit  
          Response.Buffer = True
                'do not cache this page on the client
          Response.CacheControl = "no-cache"
          Response.AddHeader "Pragma", "no-cache"
          Response.Expires = -1
BenjyAuthor Commented:
In that case, no I don't have access to the pages. I am reading information from third party websites.
Richie_SimonettiIT OperationsCommented:
If it is allow, you could delte cache entries before navigate again to same site:
Richie_SimonettiIT OperationsCommented:
Just a question: How do you know that page viewed is from cache and not from web site?
BenjyAuthor Commented:
I thought of using Internet Explorer instead of webbrowser, but I only know how to use it by declaring it (dim ie as new internetexplorer) and not by placing an object of it on the form.
1. is there a way to place it on the form?
2. even better, how can I use it's events w/o having an object on the form (afternavigate, downloadcomplete etc.)?
BenjyAuthor Commented:
Already tried and works. Thanks.
Richie_SimonettiIT OperationsCommented:
krot is right.
You need to add in declarations section of form

dim withevents IE as internetexplorer

set IE = new internetexplorer
with IE
     .navigate ""
     .visible = true
end with
end sub

IE and webbrowser use the same Internet configurations (Example: if you set in advanced tab of internet explorer
 configuration "No display images", webbrowser will not display images also)
Richie_SimonettiIT OperationsCommented:
So, if you delete the cache, nor IE neither Webbrowser control couldn't find any entry.
BenjyAuthor Commented:
Thanks but I don't think it is appropiate to delete a users cache without asking him.
Thanks again for your effort.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.