Showing posts with label web. Show all posts
Showing posts with label web. Show all posts

Thursday, January 11, 2007

Welcome to the launch of IIIT LAN Browser 1.0 and FuckProxy 0.2

So all my readers( thats only me, I guess :P But isn't this blog meant for me only?) , I did some good work in this winter vacation. I released FuckProxy 0.2, the upgrade for the old 0.1 and made a new firefox extension IIIT LAN Browser. See my post here that kind of advertises it :D

This is the change log for FuckProxy 0.2:
1. Fixed a few bugs.
2. Added better support for ftp.
3. Added auto-update feaure.
4. Changed the position of FP Button as the previous position was interfering with the toolbars of delicious,etc.
5. Now typing "http" in the address bar is not a compulsion.

IIIT LAN Browser is an extension for the LAN Browser CGI proxy I had earlier. It provides the same functionality but much more easier to use now. Apart from that its much much more robust. The earlier version used to throw errors on half of the sites because of bad parsing. But this one does not parses at all. It directly uses the DOM Tree generated by firefox! So no problem at all. I guess no CGI proxy in world would have as robust parsing as this one.(Well if I dont't parse at all and use Firefox's work, then obviously it will be robust :P ).
I also added login functionality so that only iiitians can use it. You need to enter your 200 login and password to use it. Have fun...

PS: I have been always saying "PHP sucks, Python rocks". But looks like its not so true. However good python may be, but when it comes to making sites, PHP has the greatest no. of functionalities available. Python does not even have basic Session support!

How to refresh a page that is not loaded?

First of let us understand the heading of my post ;) If a page is already loaded in the browser, there are several methods to refresh it. You will find them all over the internet.
For example, you can use:-

  1. <equiv="refresh" content="5">
  2. location.reload(true)
  3. javascript:history.go(0)
  4. etc.
However, consider a different scenario. I typed the url of a page "A" that requires login. Now the page will redirect you to the login page "B". After you login successfully, you will again be redirected to the actual page that you requested, that is page A. Now your browser knows from its cache, that when you earlier requested page A, it was redirected to page B. So it will now not send a request for page A to server. It will directly load the contents of page B instead! Now browser is doing correct by trying to save network bandwidth and by trying to reduce server load. But in our case its a problem.
Now you will ask this scenario happens in most of the sites and they all work perfectly fine. The reason is that in most of the sites, when they redirect you after successful login, to page A, they change the url of A a little bit. That is mostly you will find that after you login, there will be some sid, or username appended to the url. That concatenation makes this url not same a A and so browser loads it all over again and the site seems to be working fine.(though the site maker has no idea about all this and was just lucky).
But I have a site where the url of page A does not changes. There are some restrictions and the url of Page A has to remain exactly same. So how do I solve the problem? I searched all over net but couldn't find.(though there must be some solution). But right now I am using this method:-

<html>
<body onLoad="document.form1.submit();" >
Login successful. You are being redirected to the page requested by you.
<form method="post" action="URL of the page to redirect to" name="form1">
</form>
</body>
</html>

Note that the above thing will ask the browser to use POST method. And browser knows that pages fetched with POST method are dynamic and it can't rely on cache. So it won't rely on cache and ask a copy of the page again from the server. Thats it.

PS: Even if the urls are same, browser will sometimes fetch the new copy from the server. This is just my observation. Because in my lab, I had no problem with the simple redirection. But I found that at few other places the cache copy was being used. So I had to use the post method. I guess this all depends on browser settings and proxy settings.

PS: The above problem happened with me with my IIIT LAN Browser project.