multipart/mixed html's

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Niels Berkers

    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


  • Manuel Lemos

    #2
    Re: multipart/mixed html's

    Hello,

    On 02/21/2004 04:22 PM, Niels Berkers wrote:[color=blue]
    > 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[/color]

    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


    PHP Reviews - Reviews of PHP books and other products


    Metastorage - Data object relational mapping layer generator

    Comment

    • Niels Berkers

      #3
      Re: multipart/mixed html's

      Thanks for your reaction

      "Manuel Lemos" <mlemos@acm.org > wrote in message
      news:c18ihn$1fh 24r$1@ID-138275.news.uni-berlin.de...[color=blue]
      > Hello,
      >
      > On 02/21/2004 04:22 PM, Niels Berkers wrote:[color=green]
      > > Hi,
      > > i'd like to host my web pages using multiparts to reduce the number[/color][/color]
      of[color=blue][color=green]
      > > 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[/color]
      >
      > What are you talking about? Spliting content over multiple pages
      > eventually with navigation links?[/color]
      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
      [color=blue]
      >
      > --
      >
      > 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[/color]


      Comment

      • Chung Leong

        #4
        Re: multipart/mixed html's

        It's called HTTP persistent connection.

        Uzytkownik "Niels Berkers" <meel_me_niet@h otmail.com> napisal w wiadomosci
        news:103fkn5qsu cd460@corp.supe rnews.com...[color=blue]
        > nope,
        > inline images within te html document. I've got a very high hit rate[/color]
        on[color=blue]
        > 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.[/color]


        Comment

        • Niels Berkers

          #5
          Re: multipart/mixed html's

          Thanks Leong!
          do you've got any site to start with ?

          Regards

          Niels
          "Chung Leong" <chernyshevsky@ hotmail.com> wrote in message
          news:M6WdndZgv-eNQardRVn-hQ@comcast.com. ..[color=blue]
          > It's called HTTP persistent connection.
          >
          > Uzytkownik "Niels Berkers" <meel_me_niet@h otmail.com> napisal w wiadomosci
          > news:103fkn5qsu cd460@corp.supe rnews.com...[color=green]
          > > nope,
          > > inline images within te html document. I've got a very high hit rate[/color]
          > on[color=green]
          > > 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[/color][/color]
          are[color=blue][color=green]
          > > needed to serve our customers.[/color]
          >
          >[/color]


          Comment

          • Randy Webb

            #6
            Re: multipart/mixed html's

            Niels Berkers wrote:

            <--snip-->
            [color=blue]
            >
            > 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.
            >[/color]

            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.javas cript FAQ - http://jibbering.com/faq/

            Comment

            • Niels Berkers

              #7
              Re: multipart/mixed html's

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

              regards


              Niels
              "Randy Webb" <hikksnotathome @aol.com> wrote in message
              news:YfadnahMSb 3Kfard4p2dnA@co mcast.com...[color=blue]
              > Niels Berkers wrote:
              >
              > <--snip-->
              >[color=green]
              > >
              > > nope,
              > > inline images within te html document. I've got a very high hit rate[/color][/color]
              on[color=blue][color=green]
              > > 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[/color][/color]
              are[color=blue][color=green]
              > > needed to serve our customers.
              > >[/color]
              >
              > 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.javas cript FAQ - http://jibbering.com/faq/
              >[/color]


              Comment

              • Manuel Lemos

                #8
                Re: multipart/mixed html's

                Hello,

                On 02/21/2004 06:51 PM, Niels Berkers wrote:[color=blue][color=green][color=darkred]
                >>> i'd like to host my web pages using multiparts to reduce the number[/color][/color]
                >
                > of
                >[color=green][color=darkred]
                >>>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[/color]
                >>
                >>What are you talking about? Spliting content over multiple pages
                >>eventually with navigation links?[/color]
                >
                > 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.[/color]

                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.




                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.




                --

                Regards,
                Manuel Lemos

                PHP Classes - Free ready to use OOP components written in PHP


                PHP Reviews - Reviews of PHP books and other products


                Metastorage - Data object relational mapping layer generator

                Comment

                • Niels Berkers

                  #9
                  Re: multipart/mixed html's

                  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" <mlemos@acm.org > wrote in message
                  news:c18pkn$1g6 8d4$1@ID-138275.news.uni-berlin.de...[color=blue]
                  > Hello,
                  >
                  > On 02/21/2004 06:51 PM, Niels Berkers wrote:[color=green][color=darkred]
                  > >>> i'd like to host my web pages using multiparts to reduce the number[/color]
                  > >
                  > > of
                  > >[color=darkred]
                  > >>>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?[/color]
                  > >
                  > > nope,
                  > > inline images within te html document. I've got a very high hit rate[/color][/color]
                  on[color=blue][color=green]
                  > > 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[/color][/color]
                  are[color=blue][color=green]
                  > > needed to serve our customers.[/color]
                  >
                  > 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[/color]


                  Comment

                  • Manuel Lemos

                    #10
                    Re: multipart/mixed html's

                    Hello,

                    On 02/21/2004 09:02 PM, Niels Berkers wrote:[color=blue]
                    > 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-)[/color]

                    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


                    PHP Reviews - Reviews of PHP books and other products


                    Metastorage - Data object relational mapping layer generator

                    Comment

                    • Niels Huesken

                      #11
                      Re: multipart/mixed html's

                      Hey Niels,
                      [color=blue]
                      > i'd like to, but i still have to be compatible with NS4,
                      > which doesn't handle css very well.[/color]

                      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.


                      Comment

                      • Niels Berkers

                        #12
                        Re: multipart/mixed html's

                        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" <mlemos@acm.org > wrote in message
                        news:c192ks$1fe ifu$1@ID-138275.news.uni-berlin.de...[color=blue]
                        > Hello,
                        >
                        > On 02/21/2004 09:02 PM, Niels Berkers wrote:[color=green]
                        > > you've been of great help,
                        > > you're right, composing multiparted html's might not be the solution to[/color][/color]
                        my[color=blue][color=green]
                        > > 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-)[/color]
                        >
                        > 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[/color]


                        Comment

                        • Stephen Poley

                          #13
                          Re: multipart/mixed html's

                          On Sat, 21 Feb 2004 22:51:29 +0100, "Niels Berkers"
                          <meel_me_niet@h otmail.com> wrote:
                          [color=blue]
                          >"Manuel Lemos" <mlemos@acm.org > wrote in message
                          >news:c18ihn$1f h24r$1@ID-138275.news.uni-berlin.de...[color=green]
                          >> Hello,
                          >>
                          >> On 02/21/2004 04:22 PM, Niels Berkers wrote:[/color][/color]
                          [color=blue][color=green][color=darkred]
                          >> > i'd like to host my web pages using multiparts to reduce the number[/color][/color]
                          >of[color=green][color=darkred]
                          >> > hits on the server.[/color][/color][/color]
                          [color=blue][color=green]
                          >> What are you talking about? Spliting content over multiple pages
                          >> eventually with navigation links?[/color][/color]
                          [color=blue]
                          >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.[/color]

                          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

                          Comment

                          • Niels Berkers

                            #14
                            Re: multipart/mixed html's

                            >[color=blue][color=green]
                            > >"Manuel Lemos" <mlemos@acm.org > wrote in message
                            > >news:c18ihn$1f h24r$1@ID-138275.news.uni-berlin.de...[color=darkred]
                            > >> Hello,
                            > >>
                            > >> On 02/21/2004 04:22 PM, Niels Berkers wrote:[/color][/color]
                            >[color=green][color=darkred]
                            > >> > i'd like to host my web pages using multiparts to reduce the[/color][/color][/color]
                            number[color=blue][color=green]
                            > >of[color=darkred]
                            > >> > hits on the server.[/color][/color]
                            >[color=green][color=darkred]
                            > >> What are you talking about? Spliting content over multiple pages
                            > >> eventually with navigation links?[/color][/color]
                            >[color=green]
                            > >nope,
                            > > inline images within te html document. I've got a very high hit rate[/color][/color]
                            on[color=blue][color=green]
                            > >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.[/color]
                            >
                            > 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.[/color]

                            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.
                            [color=blue]
                            >
                            > 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.[/color]

                            nope, i know where i'm talking about. just searching for better solutions
                            than i've already got.
                            [color=blue]
                            >
                            > 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[/color]

                            something like that...
                            [color=blue]
                            > 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.
                            >[/color]
                            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
                            AVROTROS maakt cultuur toegankelijk voor iedere Nederlander, van jong tot oud.





                            Comment

                            • Niels Berkers

                              #15
                              Re: multipart/mixed html's

                              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" <niels@monarch. de> wrote in message
                              news:4037fb4d_1 @news.isis.de.. .[color=blue]
                              > Hey Niels,
                              >[color=green]
                              > > i'd like to, but i still have to be compatible with NS4,
                              > > which doesn't handle css very well.[/color]
                              >
                              > 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.
                              >
                              >[/color]


                              Comment

                              Working...