473,397 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

multipart/mixed html's

Hi,
i'd like to host my web pages using multiparts to reduce the number of
hits on the server.
i know this isn't a real PHP subject, but i'll try it anyway.
i've been searching the web for solutions and examples with no succes.
does anybody know a good starting point
hints / tips are also welcome

Regards

Niels Berkers
Jul 17 '05 #1
34 4388
Hello,

On 02/21/2004 04:22 PM, Niels Berkers wrote:
Hi,
i'd like to host my web pages using multiparts to reduce the number of
hits on the server.
i know this isn't a real PHP subject, but i'll try it anyway.
i've been searching the web for solutions and examples with no succes.
does anybody know a good starting point
hints / tips are also welcome


What are you talking about? Spliting content over multiple pages
eventually with navigation links?

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #2
Thanks for your reaction

"Manuel Lemos" <ml****@acm.org> wrote in message
news:c1*************@ID-138275.news.uni-berlin.de...
Hello,

On 02/21/2004 04:22 PM, Niels Berkers wrote:
Hi,
i'd like to host my web pages using multiparts to reduce the number of hits on the server.
i know this isn't a real PHP subject, but i'll try it anyway.
i've been searching the web for solutions and examples with no succes.
does anybody know a good starting point
hints / tips are also welcome
What are you talking about? Spliting content over multiple pages
eventually with navigation links?

nope,
inline images within te html document. I've got a very high hit rate on
our sites. Due to backward compatebility
to NS4, lots of spacers. I'd like to send this spacer just ones inline,
including all the other images too. So that the communication
to our server is minimized and thus less sockets and apache processes are
needed to serve our customers.

thanks in advance

Regards

Niels Berkers

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

Jul 17 '05 #3
It's called HTTP persistent connection.

Uzytkownik "Niels Berkers" <me**********@hotmail.com> napisal w wiadomosci
news:10*************@corp.supernews.com...
nope,
inline images within te html document. I've got a very high hit rate on our sites. Due to backward compatebility
to NS4, lots of spacers. I'd like to send this spacer just ones inline,
including all the other images too. So that the communication
to our server is minimized and thus less sockets and apache processes are
needed to serve our customers.

Jul 17 '05 #4
Thanks Leong!
do you've got any site to start with ?

Regards

Niels
"Chung Leong" <ch***********@hotmail.com> wrote in message
news:M6********************@comcast.com...
It's called HTTP persistent connection.

Uzytkownik "Niels Berkers" <me**********@hotmail.com> napisal w wiadomosci
news:10*************@corp.supernews.com...
nope,
inline images within te html document. I've got a very high hit rate

on
our sites. Due to backward compatebility
to NS4, lots of spacers. I'd like to send this spacer just ones inline,
including all the other images too. So that the communication
to our server is minimized and thus less sockets and apache processes are needed to serve our customers.


Jul 17 '05 #5
Niels Berkers wrote:

<--snip-->

nope,
inline images within te html document. I've got a very high hit rate on
our sites. Due to backward compatebility
to NS4, lots of spacers. I'd like to send this spacer just ones inline,
including all the other images too. So that the communication
to our server is minimized and thus less sockets and apache processes are
needed to serve our customers.


While you are at it, stop using spacers and tables for layout and you
won't have that problem.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 17 '05 #6
i'd like to, but i still have to be compatible with NS4,
which doesn't handle css very well.

regards
Niels
"Randy Webb" <hi************@aol.com> wrote in message
news:Yf********************@comcast.com...
Niels Berkers wrote:

<--snip-->

nope,
inline images within te html document. I've got a very high hit rate on our sites. Due to backward compatebility
to NS4, lots of spacers. I'd like to send this spacer just ones inline,
including all the other images too. So that the communication
to our server is minimized and thus less sockets and apache processes are needed to serve our customers.


While you are at it, stop using spacers and tables for layout and you
won't have that problem.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/

Jul 17 '05 #7
Hello,

On 02/21/2004 06:51 PM, Niels Berkers wrote:
i'd like to host my web pages using multiparts to reduce the number
of
hits on the server.
i know this isn't a real PHP subject, but i'll try it anyway.
i've been searching the web for solutions and examples with no succes.
does anybody know a good starting point
hints / tips are also welcome


What are you talking about? Spliting content over multiple pages
eventually with navigation links?


nope,
inline images within te html document. I've got a very high hit rate on
our sites. Due to backward compatebility
to NS4, lots of spacers. I'd like to send this spacer just ones inline,
including all the other images too. So that the communication
to our server is minimized and thus less sockets and apache processes are
needed to serve our customers.


Oh, I see. I do have a couple of classes to do that but only one is
published. That one is not quite for embedding images in HTML but rather
in e-mail messages. Still, you can reap the function GetDataURL that
encodes images as it can work alone outside the class. It returns a data
URL that you can use in the SRC attribute of the IMG tag. See the HTML
message sending example to see how it is used.

http://www.phpclasses.org/mimemessage
Anyway, I do think that it is a good solution. I mean I can recommend
you a better one. The problem embeddeding messages in HTML is that not
only it will not work in some browsers, but it also will make your PHP
scripts take longer and consume more memory.

Some time ago I also noticed the problem of having pages with many
images making Apache fork to many processes during a peak. What I did is
to make the images be served from a separate domain or port by an HTTP
server dedicated to serving static content.

The static content server that I used is thttpd . It is multithreaded,
so it takes much less time to serve static content from files like it is
the case of images. It works either on Unix/Linux and Windows.

All I can tell you is that the results were fantastic. I used to have
more than 100 Apache processes in average and during peaks it would blow
my server memory. Now, with thttpd serving just static content, Apache
rarely raises over 30 simultaneous processes and thttpd itself uses less
than 1.5MB of memory when running.

http://www.acme.com/software/thttpd/
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #8
Thanks Manuel,
you've been of great help,
you're right, composing multiparted html's might not be the solution to my
problem.
reducing load on the server by serving static content thru a tiny http
server, seems
to be de most logical solution. But still, it would be awesome, to serve
multiparted
files. 8-) a project for the free hours 8-)

Regards

Niels Berkers

"Manuel Lemos" <ml****@acm.org> wrote in message
news:c1*************@ID-138275.news.uni-berlin.de...
Hello,

On 02/21/2004 06:51 PM, Niels Berkers wrote:
i'd like to host my web pages using multiparts to reduce the number


of
hits on the server.
i know this isn't a real PHP subject, but i'll try it anyway.
i've been searching the web for solutions and examples with no succes.
does anybody know a good starting point
hints / tips are also welcome

What are you talking about? Spliting content over multiple pages
eventually with navigation links?


nope,
inline images within te html document. I've got a very high hit rate on our sites. Due to backward compatebility
to NS4, lots of spacers. I'd like to send this spacer just ones inline,
including all the other images too. So that the communication
to our server is minimized and thus less sockets and apache processes are needed to serve our customers.


Oh, I see. I do have a couple of classes to do that but only one is
published. That one is not quite for embedding images in HTML but rather
in e-mail messages. Still, you can reap the function GetDataURL that
encodes images as it can work alone outside the class. It returns a data
URL that you can use in the SRC attribute of the IMG tag. See the HTML
message sending example to see how it is used.

http://www.phpclasses.org/mimemessage
Anyway, I do think that it is a good solution. I mean I can recommend
you a better one. The problem embeddeding messages in HTML is that not
only it will not work in some browsers, but it also will make your PHP
scripts take longer and consume more memory.

Some time ago I also noticed the problem of having pages with many
images making Apache fork to many processes during a peak. What I did is
to make the images be served from a separate domain or port by an HTTP
server dedicated to serving static content.

The static content server that I used is thttpd . It is multithreaded,
so it takes much less time to serve static content from files like it is
the case of images. It works either on Unix/Linux and Windows.

All I can tell you is that the results were fantastic. I used to have
more than 100 Apache processes in average and during peaks it would blow
my server memory. Now, with thttpd serving just static content, Apache
rarely raises over 30 simultaneous processes and thttpd itself uses less
than 1.5MB of memory when running.

http://www.acme.com/software/thttpd/
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

Jul 17 '05 #9
Hello,

On 02/21/2004 09:02 PM, Niels Berkers wrote:
you've been of great help,
you're right, composing multiparted html's might not be the solution to my
problem.
reducing load on the server by serving static content thru a tiny http
server, seems
to be de most logical solution. But still, it would be awesome, to serve
multiparted
files. 8-) a project for the free hours 8-)


What I first explained was not really using multipart pages but rather
embedding image data in HTML IMG tags. The class that I mentioned can
also compose multipart data. I think the correct name is multipart
related HTML (AKA MHTML) and not multipart/mixed as you mentioned.

multipart/related is for bundling related parts into the same body
(page, images, style sheets, frames, etc...). multipart/mixed is for
attaching files to messages but they are parts not related and may be
displayed independently.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #10
Hey Niels,
i'd like to, but i still have to be compatible with NS4,
which doesn't handle css very well.


I predict this is your next problem. I don't think, NS4 is able to handle
multipart-, mime-encoded html-documents. But Im not sure though. I haven't
messed with those yet.
Jul 17 '05 #11
Hi Manuel,
you're right again!
surfing around / reading rfc's the correct mime would indeed be
multipart/related

ok kowning this : does anyone has an een working example of a
multipart/related page generated with PHP.
The code can be totally exotic / a mess -> just for starting
or even better a class which could do this ? The class Manuel suggested has
the functionality for creating the body, but it's missing the functionality
for sending it to the
browser ( because it an email class)

Regards Niels

"Manuel Lemos" <ml****@acm.org> wrote in message
news:c1*************@ID-138275.news.uni-berlin.de...
Hello,

On 02/21/2004 09:02 PM, Niels Berkers wrote:
you've been of great help,
you're right, composing multiparted html's might not be the solution to my problem.
reducing load on the server by serving static content thru a tiny http
server, seems
to be de most logical solution. But still, it would be awesome, to serve
multiparted
files. 8-) a project for the free hours 8-)


What I first explained was not really using multipart pages but rather
embedding image data in HTML IMG tags. The class that I mentioned can
also compose multipart data. I think the correct name is multipart
related HTML (AKA MHTML) and not multipart/mixed as you mentioned.

multipart/related is for bundling related parts into the same body
(page, images, style sheets, frames, etc...). multipart/mixed is for
attaching files to messages but they are parts not related and may be
displayed independently.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html

Jul 17 '05 #12
On Sat, 21 Feb 2004 22:51:29 +0100, "Niels Berkers"
<me**********@hotmail.com> wrote:
"Manuel Lemos" <ml****@acm.org> wrote in message
news:c1*************@ID-138275.news.uni-berlin.de...
Hello,

On 02/21/2004 04:22 PM, Niels Berkers wrote:
> i'd like to host my web pages using multiparts to reduce the numberof > hits on the server.
What are you talking about? Spliting content over multiple pages
eventually with navigation links?
nope,
inline images within te html document. I've got a very high hit rate on
our sites. Due to backward compatebility
to NS4, lots of spacers. I'd like to send this spacer just ones inline,
including all the other images too. So that the communication
to our server is minimized and thus less sockets and apache processes are
needed to serve our customers.


I don't see a problem. All the spacers should just be a single file
(spacer.gif or whatever) with different width and height attributes in
the HTML. Every visitor generates just one hit on the server for all
spacers.

Have you perhaps gone and created dozens of differently sized spacer
GIFs? Or have you perhaps done something which suppresses caching? I'd
look in those directions first.

In any case, with Netscape 4 usage down to somewhere around 1% and still
decreasing, I really wouldn't worry about cosmetics for Netscape 4 users
any more. As long as they can read the pages, that should be enough. (Or
are you at some academic institution that still uses Netscape 4 as its
main browser?) Much better to switch to CSS, and hide those bits of CSS
that NS4 doesn't understand from it. My page
http://www.xs4all.nl/~sbpoley/webmatters/netscape4.html may help.
--
Stephen Poley
Jul 17 '05 #13
>
"Manuel Lemos" <ml****@acm.org> wrote in message
news:c1*************@ID-138275.news.uni-berlin.de...
Hello,

On 02/21/2004 04:22 PM, Niels Berkers wrote: i'd like to host my web pages using multiparts to reduce the
number
of
> hits on the server. What are you talking about? Spliting content over multiple pages
eventually with navigation links?
nope,
inline images within te html document. I've got a very high hit rate

onour sites. Due to backward compatebility
to NS4, lots of spacers. I'd like to send this spacer just ones inline,
including all the other images too. So that the communication
to our server is minimized and thus less sockets and apache processes are
needed to serve our customers.


I don't see a problem. All the spacers should just be a single file
(spacer.gif or whatever) with different width and height attributes in
the HTML. Every visitor generates just one hit on the server for all
spacers.


you're right, when you're talking about a second visit to the page ( or an
other page within the site ) and mod_expires is running
otherwise you still get hits for each spacer 304 ( not modified )
when a page page is first loaded IE still checks for every spacer if it's
changed, expires doesn't work at that point.

Have you perhaps gone and created dozens of differently sized spacer
GIFs? Or have you perhaps done something which suppresses caching? I'd
look in those directions first.
nope, i know where i'm talking about. just searching for better solutions
than i've already got.

In any case, with Netscape 4 usage down to somewhere around 1% and still
decreasing, I really wouldn't worry about cosmetics for Netscape 4 users
any more. As long as they can read the pages, that should be enough. (Or
are you at some academic institution that still uses Netscape 4 as its
something like that...
main browser?) Much better to switch to CSS, and hide those bits of CSS
that NS4 doesn't understand from it. My page
http://www.xs4all.nl/~sbpoley/webmatters/netscape4.html may help.

thanks, i'll that a look at that...
i wish i could change over 20.000 pages at ones (maybe much more, i realy
don't know, anyway a lot)

regards

Niels Berkers
http://www.tros.nl


Jul 17 '05 #14
multipart/x-mixed-replace
works fine. I have had a perl script running to serve a webcam stream and it
did work fine.
but how to do this in PHP remains the question
-----------------------------^
correct english ?-) -> free translation

Cheers

Niels

"Niels Huesken" <ni***@monarch.de> wrote in message
news:40********@news.isis.de...
Hey Niels,
i'd like to, but i still have to be compatible with NS4,
which doesn't handle css very well.


I predict this is your next problem. I don't think, NS4 is able to handle
multipart-, mime-encoded html-documents. But Im not sure though. I haven't
messed with those yet.

Jul 17 '05 #15
Hello,

On 02/22/2004 08:26 AM, Niels Berkers wrote:
Hi Manuel,
you're right again!
surfing around / reading rfc's the correct mime would indeed be
multipart/related

ok kowning this : does anyone has an een working example of a
multipart/related page generated with PHP.
The code can be totally exotic / a mess -> just for starting
or even better a class which could do this ? The class Manuel suggested has
the functionality for creating the body, but it's missing the functionality
for sending it to the
browser ( because it an email class)


Actually you can reuse the whole class exactly for what you want. You
just need to compose the page and related images or other files as if it
were an e-mail, then instead of calling the Send function, just call the
GetPartHeaders and GetPartBody output for the main body part defined in
the body class variable and output it. Just look inside the Send
function if you have doubts.

Anyway, my previous idea of using data URL in <IMG SRC=> tags would
probably be more efficient as it would not require multipart page bodies.
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #16
(apologies to all for extending a thread which has nothing to do with
PHP)

On Sun, 22 Feb 2004 16:29:32 +0100, "Niels Berkers"
<me**********@hotmail.com> wrote:
I don't see a problem. All the spacers should just be a single file
(spacer.gif or whatever) with different width and height attributes in
the HTML. Every visitor generates just one hit on the server for all
spacers.
you're right, when you're talking about a second visit to the page ( or an
other page within the site )


No, I'm talking about having a lot of spacers on a page (at the first or
any other visit), which I thought was your problem.
and mod_expires is running
otherwise you still get hits for each spacer 304 ( not modified )
when a page page is first loaded IE still checks for every spacer if it's
changed, expires doesn't work at that point.


Are you saying that if a *single* image occurs ten times on a page, then
IE generates ten hits on the server? I didn't think that IE was that big
a heap of junk, though I could be wrong. At any rate in a quick test on
my own server it only generated one hit (200) the first time round, and
one (304) on refresh.
Have you perhaps gone and created dozens of differently sized spacer
GIFs? Or have you perhaps done something which suppresses caching? I'd
look in those directions first.


nope, i know where i'm talking about. just searching for better solutions
than i've already got.


--
Stephen Poley
Jul 17 '05 #17
> >> I don't see a problem. All the spacers should just be a single file
(spacer.gif or whatever) with different width and height attributes in
the HTML. Every visitor generates just one hit on the server for all
spacers.
you're right, when you're talking about a second visit to the page ( or another page within the site )


No, I'm talking about having a lot of spacers on a page (at the first or
any other visit), which I thought was your problem.


yep, that's my problem....
and mod_expires is running
otherwise you still get hits for each spacer 304 ( not modified )
when a page page is first loaded IE still checks for every spacer if it's
changed, expires doesn't work at that point.


Are you saying that if a *single* image occurs ten times on a page, then
IE generates ten hits on the server? I didn't think that IE was that big
a heap of junk, though I could be wrong. At any rate in a quick test on
my own server it only generated one hit (200) the first time round, and
one (304) on refresh.


that is with eg. 10 of the same images on the page?
do you use ethereal for sniffing ?
try capturing www.tros.nl as clean as possible without cache
then look at line 550 - 700 (unfiltered), you'll see what i mean.

then run it a again with a full cache. and look at line 250 - 400
(unfiltered)

for that domain we've solved a lot of the problems by ajusting some headers.
but we still have a few site which have hugh peeks after the are mentioned
on tv.
And these pages have to be very dynamic most of the time. So if it is
posible at all,
i'd like to send one block of data after 1 call, instead of a 100 small
pieces
which all have to be handled by apache.
Manuel, ( in the forked threadth ) suggested i'd use a thttpd to server al
my static content
which is a great idea. But still i'd like to solve the problem : how to
create a multipart/related doc.
He has given me some clues so now it time to code and test 8-)

Thanks for you time and help!
Cheers
Niels Berkers



Jul 17 '05 #18
Hello,

On 02/22/2004 08:17 PM, Niels Berkers wrote:
Manuel, ( in the forked threadth ) suggested i'd use a thttpd to server al
my static content
which is a great idea. But still i'd like to solve the problem : how to
create a multipart/related doc.


Yes, but keep in mind that is not a recommended solution. Hint: nobody
is using that in the real world. You would be just setting up an
academic experiment just to figure it would not be a good idea.

If you insist on reusing the same HTTP connection to serve the images
after the page content, you would better enable KeepAlive support on
your server. That way it will not close the HTTP connection after the
HTML page is served and the images can come by the same HTTP connection.

This is widely supported in HTTP 1.1 clients and servers, although it
has the same problem of using multipart/related pages, that is that
since the page is generated dynamically from HTTP, the whole page
loading is slowed down because the dynamic pages are usually what takes
more time to generate and is served first.

--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #19
On Mon, 23 Feb 2004 00:17:24 +0100, "Niels Berkers"
<me**********@hotmail.com> wrote:
Are you saying that if a *single* image occurs ten times on a page, then
IE generates ten hits on the server? I didn't think that IE was that big
a heap of junk, though I could be wrong. At any rate in a quick test on
my own server it only generated one hit (200) the first time round, and
one (304) on refresh.
that is with eg. 10 of the same images on the page?


Yes.
do you use ethereal for sniffing ?
No - server activity log. (It's a local server for testing only, and
I've never enabled caching.)
try capturing www.tros.nl as clean as possible without cache
then look at line 550 - 700 (unfiltered), you'll see what i mean.


Oh dear. How can I say this diplomatically? Just be straightforward, I
suppose.

That page is a terrible mess. To take one tiny example: why on earth set
CELLPADDING=0 and then use four spacer GIFs to imitate the effect of
CELLPADDING=1?

You are trying to solve the wrong problem. Give me about a day and I can
give you a page structure that looks as good and is more accessible in
modern browsers, has only small differences in Netscape 4, has few if
any spacer GIFs, and loads in a fraction of the time. Interested?
(Ik werk meestal in het Nederlands, dus dat is in ieder geval geen
probleem.)

(Remove the obvious spam trap to reply via e-mail.)

--
Stephen Poley

http://www.xs4all.nl/~sbpoley/webmatters/
Jul 17 '05 #20
Niels Berkers wrote:
i still have to be compatible with NS4,


No, you don't, and attempting to do so will make your site incompatible
with web browsers released in the last FOUR YEARS (as well as browsers
to be released in the forseeable future).

If that is what you *choose* to do, then so be it.

bblackmoor
2004-02-23
Jul 17 '05 #21
> That page is a terrible mess. To take one tiny example: why on earth set

8-) i know
i'm afraid our previous HTML guru, wasn't that much of a guru 8-)
CELLPADDING=0 and then use four spacer GIFs to imitate the effect of
CELLPADDING=1?

You are trying to solve the wrong problem. Give me about a day and I can
give you a page structure that looks as good and is more accessible in
modern browsers, has only small differences in Netscape 4, has few if
any spacer GIFs, and loads in a fraction of the time. Interested?


Thanks,
but it's a very complex system which generates the pages,
out of a bunge of templates. When we've got some extra time we will ajust
these pages but at this time it hasn't got that much of priority. For this
particular
page we used mod_expires, which reduces the hits to a somewhat acceptable
level. So you might understand now why i'm looking for other ,extra,
solutions,
knowing we've got well over 20000 pages.

Regards,
Niels


Jul 17 '05 #22
> > Manuel, ( in the forked threadth ) suggested i'd use a thttpd to server
al
my static content
which is a great idea. But still i'd like to solve the problem : how to
create a multipart/related doc.
Yes, but keep in mind that is not a recommended solution. Hint: nobody
is using that in the real world. You would be just setting up an
academic experiment just to figure it would not be a good idea.


hmm, i just want to see it for myself, and compare it to stress tests on our
servers
I expect it would be usefull during peeks at the server. Let's say i've got
a
multiparted doc. When the server is in full stress
- the people who request a page and get one, the get relatively fast
- the user gets all the info instead of some ( missing images , etc )
- less stress on the routers
- more equal divided modem users / DSL users

If you insist on reusing the same HTTP connection to serve the images
after the page content, you would better enable KeepAlive support on
your server. That way it will not close the HTTP connection after the
HTML page is served and the images can come by the same HTTP connection.
do i have to ? That's not what i want ( i think)
in that case i can only serve as much users a i've got sockets ?

This is widely supported in HTTP 1.1 clients and servers, although it
has the same problem of using multipart/related pages, that is that
since the page is generated dynamically from HTTP, the whole page
loading is slowed down because the dynamic pages are usually what takes
more time to generate and is served first.


in high server stress i can switch to static pages that won't be the
biggest issue
Jul 17 '05 #23
Hi Manuel,

I tryed this but IE(6) doesn't like it at all
mozilla(firefox) whoever does...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<BODY>

an image from rfc2397

<IMG SRC="data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw
AAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUU lvONmOZtfzgFz
ByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp
a/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQ ZXZeYGejmJl
ZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwv KOzrcd3iq9uis
F81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH
hhx4dbgYKAAA7"
ALT="Larry">

the spacer i need

<IMG
SRC="data:image/gif;base64,R0lGODlhAQABAJH/AP///wAAAMDAwAAAACH5BAEAAAIALAAAA
AABAAEAAAICVAEAOw" height="100" width="100">
</BODY>
</HTML>


Jul 17 '05 #24
Hello,

On 02/23/2004 05:02 PM, Niels Berkers wrote:
If you insist on reusing the same HTTP connection to serve the images
after the page content, you would better enable KeepAlive support on
your server. That way it will not close the HTTP connection after the
HTML page is served and the images can come by the same HTTP connection.

do i have to ? That's not what i want ( i think)
in that case i can only serve as much users a i've got sockets ?


You will run out or memory way before you run out of sockets.

Anyway, why do you think using multipart/related is different than using
KeepAlive connections?

KeepAlive connections even save your server from having to send images
that have previously been requested and where cached by the browser.
This is widely supported in HTTP 1.1 clients and servers, although it
has the same problem of using multipart/related pages, that is that
since the page is generated dynamically from HTTP, the whole page
loading is slowed down because the dynamic pages are usually what takes
more time to generate and is served first.

in high server stress i can switch to static pages that won't be the
biggest issue


If you can server your pages statically, why you want to serve them
dynamically?
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #25
Hello,

On 02/23/2004 06:12 PM, Niels Berkers wrote:
Hi Manuel,

I tryed this but IE(6) doesn't like it at all
mozilla(firefox) whoever does...


If it doesn't, it doesn't. Why don't you just stick to the traditional
solutions that are widely supported?
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #26
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Manuel Lemos wrote:
On 02/23/2004 05:02 PM, Niels Berkers wrote:
do i have to ? That's not what i want ( i think)
in that case i can only serve as much users a i've got sockets ?


You will run out or memory way before you run out of sockets.


Care to back up this claim with some facts? I've had servers
(web- and others) run out of sockets from time to time, but
with the exception of memory leaking software, never had one
run out of memory (I don't do Java though :-)
Bob
-----BEGIN PGP SIGNATURE-----
Comment: B. Johannessen <bo*@db.org> - http://db.org/contact/en/

iD8DBQFAOvIOooisUyMOFlgRAiGJAJ9altL1kaNOjOqxLEVJDS L6Mk1sogCgi/2c
755kqeWYUauhAQwJpwQvcjQ=
=Erai
-----END PGP SIGNATURE-----
Jul 17 '05 #27
Hello,

On 02/24/2004 03:41 AM, B. Johannessen wrote:
do i have to ? That's not what i want ( i think)
in that case i can only serve as much users a i've got sockets ?


You will run out or memory way before you run out of sockets.

Care to back up this claim with some facts? I've had servers
(web- and others) run out of sockets from time to time, but
with the exception of memory leaking software, never had one
run out of memory (I don't do Java though :-)


If you run out of sockets it is because you exceeded some configuration
limit. Anyway, to exceed any reasonable configuration limit you must be
doing something abusive that you seem to not be telling or it is not
accurately as you say. Are you sure it was not the Web server Max
clients or max server processes?

Anyway, back to the original thread, persistent HTTP connections are
precisely to avoid many simultaneous connections to the same server and
the browser uses the same HTTP connection during the same page request .

If you are concerned that the same user monopolizes the same connection
for many different consecutive page requests, just reduce the keep alive
timeout to 1 or 2 seconds and the connection will not last between
consecutive normal page browsing.

Anyway, KeepAlive is not the recommended solution either. My original
recommendation is to serve images with a separate dedicated HTTP server
like thttpd .
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #28
On Mon, 23 Feb 2004 18:39:42 +0100, "Niels Berkers"
<me**********@hotmail.com> wrote:
That page is a terrible mess. To take one tiny example: why on earth set


8-) i know
i'm afraid our previous HTML guru, wasn't that much of a guru 8-)


OK, at least I don't have to try and convince you of that. ;-)
CELLPADDING=0 and then use four spacer GIFs to imitate the effect of
CELLPADDING=1?

You are trying to solve the wrong problem. Give me about a day and I can
give you a page structure that looks as good and is more accessible in
modern browsers, has only small differences in Netscape 4, has few if
any spacer GIFs, and loads in a fraction of the time. Interested?


Thanks,
but it's a very complex system which generates the pages,
out of a bunge of templates. When we've got some extra time we will ajust
these pages but at this time it hasn't got that much of priority. For this
particular
page we used mod_expires, which reduces the hits to a somewhat acceptable
level. So you might understand now why i'm looking for other ,extra,
solutions,
knowing we've got well over 20000 pages.


Right, but presumably very much less than 20000 templates! And as your
opening page is rather your visiting card, and currently takes 30+
seconds to download over a 56K modem, it seems well worth at least
tidying that one up.

Anyway, I'm sure I could help you in that direction, and you know where
to find me. Good luck with your interim solutions.

--
Stephen Poley
Jul 17 '05 #29
Thanks for you time and advice Stephen!

Regards,

Niels Berkers

PS. mochten we je nodig hebben ik weet je idd te vinden 8-)

Jul 17 '05 #30
Hi Manuel,
Anyway, back to the original thread, persistent HTTP connections are
precisely to avoid many simultaneous connections to the same server and
the browser uses the same HTTP connection during the same page request .

If you are concerned that the same user monopolizes the same connection
for many different consecutive page requests, just reduce the keep alive
timeout to 1 or 2 seconds and the connection will not last between
consecutive normal page browsing.
Ok, when using a persistent connection, apache still as to handle all the
hits.
maybe up to 200 for just 1 page. When I have multipart/related doc apache
would have to handle just one hit and push out a block of data.
In the server multipart/related docs also have to be faster, when you can
put all
if the content in one file, it takes less IO , than gathering all info for
each user.
On a peek load, i think, it easier just to push out data in one block,
instead of
100 small blocks. Specialy when you're talking about small files ( less than
1500 mtu incl header ) On the other hand, i don't exactly know who a
browser/apache handles a KeepAlive.
Anyway, KeepAlive is not the recommended solution either. My original
recommendation is to serve images with a separate dedicated HTTP server
like thttpd .


Yep, an that's what we're gona use 8-)
Regards

Niels Berkers

Jul 17 '05 #31
> If it doesn't, it doesn't. Why don't you just stick to the traditional
solutions that are widely supported?


Maybe I just hard headed 8-)
Just have to try everything myself...
Regards

Niels Berkers

Jul 17 '05 #32
I think i'd cleared that one
earler on in the thread...

Regards
Niels Berkers
Jul 17 '05 #33
"Niels Berkers" <me**********@hotmail.com> wrote in message
news:10*************@corp.supernews.com...
Hi,
i'd like to host my web pages using multiparts to reduce the number of
hits on the server.
i know this isn't a real PHP subject, but i'll try it anyway.
i've been searching the web for solutions and examples with no succes.
does anybody know a good starting point
hints / tips are also welcome

Regards

Niels Berkers


Most browsers do not support multipart (and dont ask me why, or which)

However, I do understand what you are talking about, is your question more
of:

I do not like mutliple connections for each resource on and including the
page, is there another way?

if so, then yes, turn on persistant connections on your webserver, thus one
TCP connection is made, and several resources are reqested across it. still
apears as several hits in the log, but only one TCP connection.
Also, give apearance of faster site, due to lack of making and breaking
connections.

--
Mike Bradley
http://www.gzentools.com -- free online php tools
Jul 17 '05 #34
Hello,

On 02/24/2004 05:41 PM, Niels Berkers wrote:
Anyway, back to the original thread, persistent HTTP connections are
precisely to avoid many simultaneous connections to the same server and
the browser uses the same HTTP connection during the same page request .

If you are concerned that the same user monopolizes the same connection
for many different consecutive page requests, just reduce the keep alive
timeout to 1 or 2 seconds and the connection will not last between
consecutive normal page browsing.


Ok, when using a persistent connection, apache still as to handle all the
hits.


Yes, but the same HTTP connection is reused to make many requests of the
same page. It is not like it will open 200 connections to fetch 200
images. That is the point of Keep-Alive.
--

Regards,
Manuel Lemos

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/

Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
Jul 17 '05 #35

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Raaijmakers, Vincent \(GE Infrastructure\) | last post by:
My web server (apache+mod_python) needs to reply on some session with a multipart connection. My idea is to use the content-type of multipart/mixed; boundary=--myboundary The data that I would...
3
by: Wilfred Nilsen | last post by:
I am using the Mozilla XMLHttpRequest in multipart/x-mixed-replace mode such that the server can push data to the client. The problem that I encountered is that the onload event listener does...
0
by: chaitan | last post by:
Hi, I have a search engine site written in Perl. How could I display a temporarily page while the system retrieving data, then a page refresh, display the search result in a new page? I try to do...
0
by: Werner Maier | last post by:
Hi please can anybody help me to read a WEB side with Content-Type: multipart/x-mixed-replace ("Server Push") . I am a absolutly newbie with c# .net. i have problems to read the boundarys to...
1
by: KReichert | last post by:
How do you retrieve the streaming 'parts' of a multipart message from a WebRequest? Here is the situation. A WebRequest is submitted to a server (http://TheServer:80/GetMedia?ID=1). This...
2
by: Der tolle Emil | last post by:
Hi! I wrote a little function to send emails which works quite well. I already managed to send attachments correctly (also more than 1 per email) but I am not able to send a HTML mail containing...
4
by: yoram.ayalon | last post by:
Hi, I need to create a multipart request to UPS manifest upload electronic service. UPS wants the request to consist of a series of headers and bodies, and its not clear how can I use the...
0
by: sachintandon | last post by:
Hello all, Thanks in advance for your help I have a problem in sending emails, my requirement is to send multipart alternative emails with attachments, I'm able to send text with attachments or...
2
by: madmak | last post by:
Hi, I am a noob with PHP and need some asistance regarding PHP and lotus notes. I am trying to create a multipart message in PHP to send mail via lotus notes. Here is the code snippet. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.