I have reduced my scope a little now. What i have done is when a cache is missed, i will have a filter to see if the url has a parameter made by me, like "?abc_is_good". If yes, go direct, If no, (which should be at the first time.), then the squid will generate a page and the page have some javascript to redirect the user to their requested url with my generated tag "?abc_is_good" at the end of the url. Then the page should be in a "loading" mode. The generated page will also have javascript to open a new browser window and ask whether the user want to load the page in background in stead of waiting. The popup window will know the url he/she requested and when he click the background load button, the page will be stored in something like a stack for background loading. Currently i have done most part exempt the part about background loading. But i have face problems.
1. When a page is redirected that way, the user will lost the parameter they posted in a form in a post action, so they will never get to the page because the destination server will log him off. This is the case in hotmail. 2. I have done something to filter out the r->urlpath.buf and see if it contains word like html, jsp etc, if yes, then i use this scheme. Otherwise if it contains other words, i will just go direct for a miss. However, this means that i have to include any extension a webpage may have. I don't mind if i incorrectly forward a text page directly since it do no harm exempt from going direct. 3. In the background loading method, i have create a new request_t and storeEntry using the tool supplied in store.c and HttpRequest.c. and then i copy the original url, host information and put in the new request_t and storeEntry object. and then i try to forward the request from a threaded function using this new object. like fwdStart(-1, new_e, new_t); but i don't think the page is being fatched this way. But this is better then the way i tried last time, because at lease squid won't crash. Am i missing something so the connection is not done? 4. I want to trace the program, i run squid using squid -D mode already, but the error doesn't shown in screen. i thought they are outputed in stderr. Do i need to reconfigure squid to do that? thanks lot. cheers Louis ----- Original Message ----- From: "Henrik Nordstrom" <[EMAIL PROTECTED]> To: "Louis Lau" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Saturday, February 08, 2003 12:09 AM Subject: Re: How to push prompt to browser? > You have two options > > a) Send a temporary redirect to another URL with the question > > b) Respond with a uncacheable content displaying the question. > > > And in both cases you have figure out a way how the user can confirm > that he wants the object downloaded.. > > > However you need to know that HTTP knows nothing about "pages". In HTTP > a "page" simply consists of N objects, each requested individually with > no direct relation between the requests, usually starting with the HTML > content, then style sheets, inline images etc.. and the browser also > caches items locally so you may end up with only having a request for a > single inlined image when the user selects to display a certain page, or > none at all.. It is only the browser who has a notion of what a "page" > is by parsing the HTML content. > > Lets take a simple page as an example > > http://www.squid-cache.org/ > > This page consists of the following HTTP objects > > http://www.squid-cache.org/ > http://www.squid-cache.org/Squidlogo2.gif > http://www.squid-cache.org/Icons/squidnow.gif > http://www.squid-cache.org/Icons/cache_now.gif > > When the browser has all 4 objects the page is fully displayed. If the > browser is missing one or more of these objects it will send individual > HTTP requests for each missing object. > > To Squid the request for http://www.squid-cache.org/ is no different > from the request for http://www.squid-cache.org/Squidlogo2.gif or any of > the other inline images. It is just a HTTP request for a specific URL. > > > You also need to keep in mind that there is also many other applications > than browsers using HTTP. There is such things as antivirus agent > updates, various active applets requesting special information (i.e. > "realtime" stock exchange rates or whatever)... and many more, and you > do not want these to be "disturbed" by your question as there is no > human in the other end who can confirm the question.. > > > > > > fre 2003-02-07 klockan 09.30 skrev Louis Lau: > > I don't know if this would simplify my problem. Does anyone know how to push > > prompt to browser in some occassion? like if they are accessing a site not > > in cache, prompt them and only get that page directly if they want? > > -- > Henrik Nordstrom <[EMAIL PROTECTED]> > MARA Systems AB, Sweden >
