Magento Forum

   
Proxy.php - Improvement in performance? 
 
srinigenie
Guru
 
Avatar
Total Posts:  539
Joined:  2008-02-04
 

Hi all,

Magento 1.0 version uses proxy.php to collate the Javascript files and send them as one request. And in one thread
http://www.magentocommerce.com/boards/viewthread/4298

I see Moshe’s reply stating

We have implemented dynamic script compression, so all scripts are served as one file with spaces removed, gzip/deflated, and with cache management headers.

For frontend all scripts are one socket / 55K, and for admin it’s about 80K together with ext-js.

Server overhead is about 1ms.

The pages are just flying.

But in reality, I observe that firebug shows 227 KB still for the Javascript on the home page and the performance is still a bit worrying. Also wonder if the following can be/has been implemented -
i. Use proxy.php for CSS files as well
ii. Has GZIP been used to zip the contents of Javascript and CSS files?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

1. in theory it could be used for CSS but magento allows dynamic location of skin css files, and correct implementation of proxy.php might require minor changes in architecture, that can affect backward compatibility with themes. Perhaps in 2.0

2. Please try enabling gzip in .htaccess, it is disabled by default to allow real-time http traffic in PEAR upgrades console and dataflow progress window.

 
Magento Community Magento Community
Magento Community
Magento Community
 
srinigenie
Guru
 
Avatar
Total Posts:  539
Joined:  2008-02-04
 

thanks Moshe....that did it for me smile ...improved my site a great deal ..though I need to reduce the number of requests that are being requested for CSS, images etc ...

And one more thing when you said Gzip interferes with dataflow progress window, does that mean something serious?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Nothing serious, you will just not be able to see the progress as it goes, only after everything is done.

 
Magento Community Magento Community
Magento Community
Magento Community
 
substrakt_jim
Jr. Member
 
Total Posts:  10
Joined:  2008-03-22
Birmingham, UK
 

2. Please try enabling gzip in .htaccess, it is disabled by default to allow real-time http traffic in PEAR upgrades console and dataflow progress window.

How does one actually enable gzip compression - my js is also hitting around 260kb and is really making the site sluggish.

I’ve tried uncommenting what I thought was the correct parts of the htaccess, but to no avail :

</IfModule>

<
IfModule mod_deflate.c>

############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

    # Insert filter
    
SetOutputFilter DEFLATE

    
# Netscape 4.x has some problems...
    
BrowserMatch ^Mozilla/4 gzip-only-text/html

    
# Netscape 4.06-4.08 have some more problems
    
BrowserMatch ^Mozilla/4\.0[678] no-gzip

    
# MSIE masquerades as Netscape, but it is fine
    
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    
# Don't compress images
    
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

    
# Make sure proxies don't deliver the wrong content
    
Header append Vary User-Agent env=!dont-vary

</IfModule>

<
IfModule mod_ssl.c>

What are the steps needing to be taken to get the compression going?

For reference my installation is on a Media Temple DV server.

 
Magento Community Magento Community
Magento Community
Magento Community
 
srinigenie
Guru
 
Avatar
Total Posts:  539
Joined:  2008-02-04
 

you need to restart the apache server after changing this configuration for gzip to take effect

 
Magento Community Magento Community
Magento Community
Magento Community
 
Mark_Kimsal
Sr. Member
 
Total Posts:  186
Joined:  2007-09-12
Michigan, USA
 

I noticed that if you muck with the header block, and move the JS below the CSS (where it creates the proxy.php url) it speeds up rendering of the page slightly.  Browers need CSS for position, but not JS.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

@srinigenie: i do not think that changes in .htaccess require apache restart.

@substrakt_jim: is it possible that mod_deflate is not installed/enabled?

 
Magento Community Magento Community
Magento Community
Magento Community
 
srinigenie
Guru
 
Avatar
Total Posts:  539
Joined:  2008-02-04
 

Finally got the proxy.php to help me compress and club my CSS files as well

http://www.magentocommerce.com/boards/viewthread/8032/

Take a look and let me know incase you find something wrong ....

 
Magento Community Magento Community
Magento Community
Magento Community
 
K4doyle
Jr. Member
 
Total Posts:  12
Joined:  2008-03-27
 
substrakt_jim - 01 May 2008 09:40 AM

2. Please try enabling gzip in .htaccess, it is disabled by default to allow real-time http traffic in PEAR upgrades console and dataflow progress window.

How does one actually enable gzip compression - my js is also hitting around 260kb and is really making the site sluggish.

I’ve tried uncommenting what I thought was the correct parts of the htaccess, but to no avail :

</IfModule>

<
IfModule mod_deflate.c>

############################################
## enable apache served files compression
## http://developer.yahoo.com/performance/rules.html#gzip

    # Insert filter
    
SetOutputFilter DEFLATE

    
# Netscape 4.x has some problems...
    
BrowserMatch ^Mozilla/4 gzip-only-text/html

    
# Netscape 4.06-4.08 have some more problems
    
BrowserMatch ^Mozilla/4\.0[678] no-gzip

    
# MSIE masquerades as Netscape, but it is fine
    
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    
# Don't compress images
    
SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip dont-vary

    
# Make sure proxies don't deliver the wrong content
    
Header append Vary User-Agent env=!dont-vary

</IfModule>

<
IfModule mod_ssl.c>

What are the steps needing to be taken to get the compression going?

find this section, line 50 in htaccess, and uncomment “php_flag zlib.output_compression on”

## enable resulting html compression.

#php_flag zlib.output_compression on

 
Magento Community Magento Community
Magento Community
Magento Community
 
johnson334456
Jr. Member
 
Total Posts:  1
Joined:  2013-06-09
 

I strongly recommend to use Wamp server (x86) for that, the apc.dll for the x64 version of windows doesn’t work well.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top