Loading ...
Sorry, an error occurred while loading the content.
 

gzip php output

Expand Messages
  • Sean M Montague
    Can anyone offer suggestions on the best way to compress php output of svg? Does the example below compress all the the svg including what is outside of the
    Message 1 of 4 , Dec 31, 2006
      Can anyone offer suggestions on the best way to compress php output of
      svg? Does the example below compress all the the svg including what is
      outside of the php tags? Will the content of php
      require_once("php/map.php"); get compressed also? Thank you.

      --Sean


      <?php ob_start("ob_gzhandler");?>
      <?php
      header("Content-type: image/svg+xml");
      @session_start;
      require_once("php/lib/pg_connect.php");
      ?>
      <?="<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>"?>
      <svg id="master" x="0" y="0" width="100%" height="100%" viewBox="0 0
      1003 594" zoomAndPan="disable" preserveAspectRatio="xMinYMin meet">
      <defs>
      <script name="skip" type="text/ecmascript"
      xlink:href="JavaScript/addGeom.js">
      </script>

      <script name="skip" type="text/ecmascript"
      xlink:href="JavaScript/WebCore.js">
      </script>
      </defs>
      <?php require_once("php/map.php");?>
      <rect x="151" y="55" width="688" height="509"
      style="fill:none;stroke:black;stroke-width:1;"/>
      </svg>
    • Reid Priedhorsky
      ... If you are using Apache, look into mod_gzip. Good luck, Reid
      Message 2 of 4 , Jan 1, 2007
        Sean M Montague wrote:
        > Can anyone offer suggestions on the best way to compress php output of
        > svg? Does the example below compress all the the svg including what is
        > outside of the php tags? Will the content of php
        > require_once("php/map.php"); get compressed also? Thank you.

        If you are using Apache, look into mod_gzip.

        Good luck,

        Reid
      • UmaSurya Sykam
        Hi, I want to pass image(.png or .jpeg) as an argument to button() constructor for making a button as the same way we make buttons using text or symbols. If
        Message 3 of 4 , Jan 1, 2007
          Hi,

          I want to pass image(.png or .jpeg) as an argument to button() constructor
          for making a button as the same way we make buttons using text or symbols.

          If somebody has sugessions pls pass them to me...

          thanx
          surya.
        • Andreas Neumann
          Hi Sean, I suggest doing this through Apache s mod_deflate (in Apache 2x) or mod_gzip (Apache 1.3x). Here is my configuration for Apache 2.0: LogFormat %h %l
          Message 4 of 4 , Jan 3, 2007
            Hi Sean,

            I suggest doing this through Apache's mod_deflate (in Apache 2x) or
            mod_gzip (Apache 1.3x).

            Here is my configuration for Apache 2.0:

            LogFormat "%h %l %u %t \"%r\" %>s %b \
            \"%{Referer}i\" \"%{User-Agent}i\" (%{ratio}n%%)" combined
            CustomLog /var/log/apache2/cartonet.access_log "combined"

            <Directory "/some/path/cgi/">
            SetOutputFilter DEFLATE
            AddOutputFilterByType DEFLATE image/svg+xml text/plain text/html
            # Don't compress images
            SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png|gz)$ no-gzip dont-vary
            SetEnvIfNoCase Request_URI mapserv? no-gzip dont-vary
            </Directory>

            You'd also have to enable mod_deflate like other Apache modules.

            Notice the log format definition. This way you see the compression
            rate in your web server log file.

            Works great for me with fast performance and without problems.

            Andreas

            --- In svg-developers@yahoogroups.com, Sean M Montague <scene@...>
            wrote:
            >
            > Can anyone offer suggestions on the best way to compress php output
            of
            > svg? Does the example below compress all the the svg including what
            is
            > outside of the php tags? Will the content of php
            > require_once("php/map.php"); get compressed also? Thank you.
            >
            > --Sean
            >
          Your message has been successfully submitted and would be delivered to recipients shortly.