Home ยป Php ยป multipart/mixed html’s – PHP

multipart/mixed html’s – PHP

Posted by: admin February 22, 2020 Leave a comment

Q(Question):

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

A(Answer):

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

A(Answer):

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

A(Answer):

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.

A(Answer):

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.

A(Answer):

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/

A(Answer):

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/

A(Answer):

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

A(Answer):

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. ๐Ÿ˜Ž a project for the free hours ๐Ÿ˜Ž

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

A(Answer):

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. ๐Ÿ˜Ž a project for the free hours ๐Ÿ˜Ž

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

A(Answer):

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.

A(Answer):

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. ๐Ÿ˜Ž a project for the free hours ๐Ÿ˜Ž

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

A(Answer):

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

A(Answer):

>

"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

A(Answer):

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.

A(Answer):

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

A(Answer):

(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

A(Answer):

> >> 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 ๐Ÿ˜Ž

Thanks for you time and help!
Cheers
Niels Berkers

A(Answer):

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

A(Answer):

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/

A(Answer):

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

A(Answer):

> That page is a terrible mess. To take one tiny example: why on earth set

๐Ÿ˜Ž i know
i’m afraid our previous HTML guru, wasn’t that much of a guru ๐Ÿ˜Ž

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

A(Answer):

> > 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

A(Answer):

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>

A(Answer):

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

A(Answer):

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

A(Answer):

—–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—–

A(Answer):

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

A(Answer):

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

๐Ÿ˜Ž i know
i’m afraid our previous HTML guru, wasn’t that much of a guru ๐Ÿ˜Ž

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

A(Answer):

Thanks for you time and advice Stephen!

Regards,

Niels Berkers

PS. mochten we je nodig hebben ik weet je idd te vinden ๐Ÿ˜Ž

A(Answer):

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 ๐Ÿ˜Ž
Regards

Niels Berkers

A(Answer):

> 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 ๐Ÿ˜Ž
Just have to try everything myself…
Regards

Niels Berkers

A(Answer):

I think i’d cleared that one
earler on in the thread…

Regards
Niels Berkers

A(Answer):

"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

A(Answer):

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