mime multipart html's

Joined
Feb 4, 2010
Messages
28
Reaction score
0
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

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

something like this ?
<?php
header( "Content-type: multipart/mixed;");
header( "boundary=myboundary\n\n");
header( "--myboundary\n" );
header( "Content-type: image/jpeg\n\n");
readfile( "btn_test1jpg" );
echo( "\n--myboundary\n" );
//sleep(5);
echo( "Content-type: image/jpeg\n\n");
readfile( "btn_test2.jpg" );
echo( "\n--myboundary\n" );
?>
 
Last edited by a moderator:
M

Michael Wilcox

> thus, inline images within te html document.

Images are cached on virtually all visual browsers; the browser won't
download the same image multiple times. In any case, there are only a few
recent browsers that could read an image with its data actually embeded in
the HTML source.
Due to backward compatebility
to NS4, lots of spacers.

Oh, you probably think NS 4 is worth designing for. Make a structred page,
style it with CSS, hide the CSS from NS 4, then let the few remaining people
with this broken, old technology see a plain, yet still useful, page.
something like this ?
<?php
header( "Content-type: multipart/mixed;");
header( "boundary=myboundary\n\n");
header( "--myboundary\n" );
header( "Content-type: image/jpeg\n\n");
readfile( "btn_test1jpg" );
echo( "\n--myboundary\n" );
//sleep(5);
echo( "Content-type: image/jpeg\n\n");
readfile( "btn_test2.jpg" );
echo( "\n--myboundary\n" );

This script accesses the image with each hit, instead of allowing the
browser to cache, thus increasing server stress.
 
Last edited by a moderator:
Joined
Feb 4, 2010
Messages
28
Reaction score
0
Thanks for your reaction Michael,

"Michael Wilcox" <[email protected]> wrote in message
news:[email protected]...
> > thus, inline images within te html document.

>
> Images are cached on virtually all visual browsers; the browser won't
> download the same image multiple times. In any case, there are only a few
> recent browsers that could read an image with its data actually embeded in
> the HTML source.


indeed they are cached, but you still get 304's. With mod_expires one can
reduce this a lot.
But even then when i've only have to handle 1 connection instead of 50 (
spacers and images ), i'd win a lot.
with mod_expires i can reduce it even more. So the total result would be
more stress on the server when a page
must be served, on the other hand much less requests. An other advantage is,
i think ( not sure about it ) no indirect image theft,
and no direct image theft ( hot linking ).

>
> > Due to backward compatebility
> > to NS4, lots of spacers.

>
> Oh, you probably think NS 4 is worth designing for. Make a structred page,
> style it with CSS, hide the CSS from NS 4, then let the few remaining

people
> with this broken, old technology see a plain, yet still useful, page.


nope, but the board of directors still use it :cool:

>
> > something like this ?
> > <?php
> > header( "Content-type: multipart/mixed;");
> > header( "boundary=myboundary\n\n");
> > header( "--myboundary\n" );
> > header( "Content-type: image/jpeg\n\n");
> > readfile( "btn_test1jpg" );
> > echo( "\n--myboundary\n" );
> > //sleep(5);
> > echo( "Content-type: image/jpeg\n\n");
> > readfile( "btn_test2.jpg" );
> > echo( "\n--myboundary\n" );

>
> This script accesses the image with each hit, instead of allowing the
> browser to cache, thus increasing server stress.


:cool: i'm convinced the above script won't work. It was just an illustration
of posible code

> --
> Michael Wilcox
> mjwilco at yahoo dot com
> Essential Tools for the Web Developer - http://mikewilcox.t35.com
>
>
 
Last edited by a moderator:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top