mime multipart html's

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

  1. Guest

    Guest

    Joined:
    Feb 4, 2010
    Messages:
    13
    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. Advertising

  2. > 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.
    --
    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
    Michael Wilcox, Feb 21, 2004
    #2
    1. Advertising

  3. Guest

    Guest

    Joined:
    Feb 4, 2010
    Messages:
    13
    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. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. c# newbie
    Replies:
    3
    Views:
    5,910
  2. Guoqi Zheng

    mime multipart message

    Guoqi Zheng, May 22, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    507
    Guoqi Zheng
    May 22, 2004
  3. Matthew Zimmer

    Multipart Mime types from a client

    Matthew Zimmer, Jun 30, 2004, in forum: Java
    Replies:
    1
    Views:
    2,252
    Matthew Zimmer
    Jun 30, 2004
  4. Xeth  Waxman
    Replies:
    0
    Views:
    9,195
    Xeth Waxman
    Dec 9, 2004
  5. Replies:
    1
    Views:
    420
Loading...

Share This Page