mime multipart html's

Discussion in 'HTML and CSS' started by Guest, Feb 21, 2004.

  1. Guest

    Guest

    Joined:
    Feb 4, 2010
    Messages:
    24
    Likes Received:
    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: Sep 20, 2010
    Guest, Feb 21, 2004
    #1
    1. Advertisements

  2. 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.
    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.
    This script accesses the image with each hit, instead of allowing the
    browser to cache, thus increasing server stress.
     
    Last edited by a moderator: Sep 20, 2010
    Michael Wilcox, Feb 21, 2004
    #2
    1. Advertisements

  3. Guest

    Guest

    Joined:
    Feb 4, 2010
    Messages:
    24
    Likes Received:
    0
    Thanks for your reaction Michael,

    "Michael Wilcox" <> wrote in message
    news:9PRZb.15168$...
    > > 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: Sep 20, 2010
    Guest, Feb 22, 2004
    #3
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.