Refreshing frames-based HTML pages or pages with targets

 
Post new topic   Reply to topic    Aprelium Forum Index -> Off Topic Discussions
View previous topic :: View next topic  
Author Message
roofrack
-


Joined: 10 Nov 2006
Posts: 4

PostPosted: Fri Nov 10, 2006 11:10 am    Post subject: Refreshing frames-based HTML pages or pages with targets Reply with quote

Hi,

I've noticed two different types of web server behaviour when it comes to handling the refresh of HTML pages that are based on frames - or that have hyperlinks which specify a target.

Take the example code below, which is a fragment from an index page.

Code:
<frameset rows="*" cols="189,*" framespacing="0" frameborder="no" border="0">
  <frame src="leftnav.html" name="leftFrame" scrolling="No" noresize="noresize" id="leftFrame" title="leftFrame" />
  <frame src="home.html" name="mainFrame" id="mainFrame" title="mainFrame" />
</frameset>


This is a typical scenario: menu in the left nav bar, content in the main frame on the right hand side.

Obviously, when I first visit this index page, the main frame displays home.html. Perhaps I then visit another page in the main frame, which might be called visit2.html.

At this point, if I hit my browser's 'Refresh' button, what should happen ?

(1) If I run Abyss, Apache, or some other commercial web server, the page that gets re-displayed in the main frame is visit2.html.

(2) I've written my own web server. I'm not saying it hasn't got issues - I'm sure it has. One of them is as follows. If I run the same set of pages I've just mentioned through my own server, the browser refresh causes the main frame to re-display home.html and not visit2.html.

The first way is the one I prefer - it seems more logical - but why can't I achieve the same effect in my own web server ? The solution can only be one of two things:

(a) Either the web server, such as Abyss, is parsing the HTML and looking for pages that use framesets and then handling them differently, or,

(b) The web server is sending particular HTTP headers back to the browser to control what happens when a frames-based page is refreshed.

Would anyone (a developer, at Aprelium perhaps ?) be able to tell me what I need to do in my web server to handle the refresh of frames so as to give the effect in item (1) above ? I promise that I'm not in competition with Aprelium - this is NOT a web server for general sale but is embedded in another product and handles special transcoding that is specific to our industry.

Thanks
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Nov 10, 2006 2:51 pm    Post subject: Re: Refreshing frames-based HTML pages or pages with targets Reply with quote

roofrack wrote:
Would anyone (a developer, at Aprelium perhaps ?) be able to tell me what I need to do in my web server to handle the refresh of frames so as to give the effect in item (1) above ? I promise that I'm not in competition with Aprelium - this is NOT a web server for general sale but is embedded in another product and handles special transcoding that is specific to our industry.


For web servers, HTML files are just a sequence of bytes. Abyss, Apache, or IIS do not even care what the HTML contains and does not even know if there is a frameset or not. Everything is done at the browser level: the browser parses the main HTML page, detects that it needs to download two or more HTML file that go into frames and so it issues two requests for these files. During all that process, there is no saved state or no "hidden" information that the web server can have to indicate that there is a relation between the 3 requests.

We recommend using a HTTP debugging tool to understand how the browser-server dialog is done in both cases. This will also help you determine the problem of the headers. In your case, may be the fact that you do not send a date header could affect the browser behavior (but this is only a guess).

A nice HTTP debugging tool we recommend is Fiddler ( http://www.fiddlertool.com/ ). It is a free utility made by Microsoft.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
roofrack
-


Joined: 10 Nov 2006
Posts: 4

PostPosted: Fri Nov 10, 2006 4:01 pm    Post subject: Reply with quote

Thanks for this - I appreciate it.

At least it tells me that commercial web servers are not specially coded to parse the HTML that flows through them.

That means that the only difference between what I do in my code and what, for instance, Abyss does, are the HTTP headers flowing back from me to the browser. And, as it happens, I have a feeling that I don't send a 'Date' header from server to browser (which is very naughty of me, having just re-read that part of the RFC for HTTP !!).

I will include the Date header and see if that fixes the problem. If it doesn't, I will download the software to monitor the headers and see what differences there are between me and Abyss.

Regards
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Sat Nov 11, 2006 12:46 pm    Post subject: Reply with quote

roofrack wrote:
Thanks for this - I appreciate it.


You're welcome. You can also have a look (or even reuse) the code of the very first version Abyss Web Server (0.3) which is very simple and contains the basics of a web server. Its source code is available from http://sourceforge.net/projects/abyss .
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
roofrack
-


Joined: 10 Nov 2006
Posts: 4

PostPosted: Mon Nov 13, 2006 10:28 am    Post subject: Reply with quote

Thanks again.

I'm now sure that the following headers always get sent from my server to user agent:

Proxy-Connection: Keep-Alive
Date
Content-Type
Content-Length (if req'd)
Server

Unfortunately (compared to Abyss X1) I'm still getting the same problem when refreshing the main frame of my page.

Based on what Fiddler is telling me, the only header I've not included yet is Last-Modified so will try that this morning - maybe thats the problem ? - then I will look at the source code you suggested.
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Off Topic Discussions All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group