473,320 Members | 2,088 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

PHP compressor

I'm looking for PHP code for compressing another PHP code.
Is there any solutions for free download?

It would be good if it can compress JS and CSS too.

Would there be significant speed improvement by compresing an PHP script?

Thank you!
Aug 21 '06 #1
4 7578
On Tue, 22 Aug 2006 00:14:38 +0200, Gale <ga**@rules.dawrote:
>I'm looking for PHP code for compressing another PHP code.
Is there any solutions for free download?

It would be good if it can compress JS and CSS too.

Would there be significant speed improvement by compresing an PHP script?
Compressing a PHP script would more likely slow things down, since it'd just
have to be decompressed by the server again. If you want to speed up PHP,
you'll get better results from a bytecode cache, such as APC, or the Zend
product.

If by compression you mean simply removing any redundant whitespace and
comments, I would expect very tiny gains in performance; nothing like what
you'd get from a bytecode compiler (which effectively does that, and
considerably more).

Compressing JS and CSS is potentially a different matter; you can get some
gains there because you reduce the amount of data sent over the network to the
client. Depends where the bottleneck is; for small files over a fast network it
won't help. You're probably best off getting your webserver to do this for you;
for Apache, see mod_deflate.

In a similar way you can also get PHP to compress the _output_ of the script,
by setting zlib.output_compression in php.ini (amongst other ways).

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Aug 21 '06 #2
Gale wrote:
I'm looking for PHP code for compressing another PHP code.
Is there any solutions for free download?

It would be good if it can compress JS and CSS too.

Would there be significant speed improvement by compresing an PHP script?
PHP files are parsed by the PHP engine (e.g. Zend) and executed.
Decreasing the physical size of the file will not make it 'faster'.

If you want to minimize the download size of all the server output,
then use a JS and CSS compressor. You can also use ZLib
(http://us2.php.net/zlib) on the server side to compress the data being
output.

Aug 21 '06 #3
Thank you both for your answers
Aug 22 '06 #4
Gale wrote:
I'm looking for PHP code for compressing another PHP code.
Is there any solutions for free download?

It would be good if it can compress JS and CSS too.

Would there be significant speed improvement by compresing an PHP script?
Not sure, if you are looking for:
1. http://www.schroepl.net/projekte/mod_gzip/
2. http://in2.php.net/ob_gzhandler

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/

Aug 26 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Ian Stirling | last post by:
I'm playing with downloading javascript to my phone, over the providers email service. It's rather slow. Is there anything that will compress javascript, doing things like reducing identifiers...
0
by: Bartosz Wójcik | last post by:
..netshrink - is an executable compressor for managed files. It uses LZMA compression library and can decrease your file size by 50%. It can also protect your files with a password. ..netshrink...
2
by: Eyal Lotem | last post by:
Hey. I have a problem in some network code. I want to send my packets compressed, but I don't want to compress each packet separately (via .encode('zlib') or such) but rather I'd like to...
34
by: davehowey | last post by:
I have a problem. I'm writing a simulation program with a number of mechanical components represented as objects. When I create instances of objects, I need to reference (link) each object to the...
6
by: erick-flores | last post by:
Hello, I want to make a report for a single compressor. Instead of showing a report for all the compressors. I would like to place a button in the compressor form, so whenever I want to display a...
2
by: erick-flores | last post by:
Hello all Form A (pk) & Form B (fk) I want to display my Form B empty whenever is the first time, that the pk form Form A, is enter. I click a button to open Form B. BUT if the pk from Form A...
1
by: arunraj2002in | last post by:
i want to write a c program --- compressor / de-compressor of a file which contains characters ‘1’,’2’, - - - ’F’. Compression should achieve at least 50% less size. Please help..
7
by: Hulm1 | last post by:
Two check boxes on the same form. I need to make check box 2 = TRUE if Check one is clicked (and so made TRUE) The following code does not work Private Sub AirSparging_AfterUpdate() If...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.