Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

javascript and css optimization
 
FOOMAN
Guru
 
Avatar
Total Posts:  669
Joined:  2007-12-13
Auckland, New Zealand
 

Can you verify that this file exists magentoshop/lib/minify/.htaccess

If it is not there please create it with the following content:

Order allow,deny
Allow from all

 
Magento Community Magento Community
Magento Community
Magento Community
 
speedbird1229
Member
 
Total Posts:  31
Joined:  2008-10-12
 
FOOMAN - 13 October 2008 11:03 AM

Can you verify that this file exists magentoshop/lib/minify/.htaccess

If it is not there please create it with the following content:


Order allow,deny
Allow from all

Yep, it does exist with the same content. There’s also an htaccess file in the “magentoshop/lib” folder. It contains:

Order deny,allow
Deny from all

 
Magento Community Magento Community
Magento Community
Magento Community
 
FOOMAN
Guru
 
Avatar
Total Posts:  669
Joined:  2007-12-13
Auckland, New Zealand
 

Can you try temporarily deleting the file magentoshop/lib/.htaccess to see if that solves the permission issue with m.php?

 
Magento Community Magento Community
Magento Community
Magento Community
 
speedbird1229
Member
 
Total Posts:  31
Joined:  2008-10-12
 

Tried, no luck :( It’s just too weird.

 
Magento Community Magento Community
Magento Community
Magento Community
 
FOOMAN
Guru
 
Avatar
Total Posts:  669
Joined:  2007-12-13
Auckland, New Zealand
 

@speedbird: how bizarre. Can you try moving m.php to your webroot and see if you can open it in your browser.

Also maybe your webhost can help trouble shooting, why this script can’t be executed. Maybe it is under a wrong user.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Georg Ringer
Member
 
Avatar
Total Posts:  63
Joined:  2008-07-04
Linz, Austria
 

Hi Fooman,

thanks for your help, it works now without any changes.

Georg

 
Magento Community Magento Community
Magento Community
Magento Community
 
aarne
Sr. Member
 
Total Posts:  130
Joined:  2007-09-06
 

I think I have a new problem regarding the minify extension.

My minifycache folder fills up as it should and m.php is executable shows text 404 when directly tried to contact.... but

if I enter for example minified reset.css to the url I don’t see the css in minified form but as follows:

��ێ� ï¿½ï¿½ï¿½)"��m+�qNN_U}�
���pE�{!�9]�|a�c���?]Gu���eOCْ�W�]E�m�� y]���f2h��lQN��ɦ:{�cG[0Ә�O�f-6?&���
$�h���X�J(M^�M��&$"�y�β�
�    ï¿½HE�A��bMC�I
hlJ�R��
$5���S7f����9�A�4��$    Íƒ(�S�����_�k]�t�AÒ¨z0N
6��g    ï¿½
'|��e�W    /��e��i��UɖЕ�F�[&���M����wH�
��@�fk��WA'
�<_ܠʼn-oX~b�'��b�{D�����:hlt�V��Y�{ˮ⟜��BlB�pA�1O4���GD*�Qq'F���“�1���?H�Ґ|�ؓ�qe-y{�w���=�'���Oϥ
P@��zf��GEQ���VJ0��lb@@m�jSJw�Q��    ï¿½ï¿½^rWB���\�H�p��iC&,nL{�+loÌžE������o��K^����'
<��ܡ�
��H
|&�^���y<5=�c�|{s��

What might be wrong, the site shows without CSS or JS.

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 

@aarne

It looks like you might have zlib compression enabled.  Check this in your .htaccess file:

## enable resulting html compression

    #php_flag zlib.output_compression on

###########################################

Make sure it’s commented out like shown.  Turning that on reproduces the problem for me.  Since minify is already compressing the files, doing it a second time seems to scramble the output.

 
Magento Community Magento Community
Magento Community
Magento Community
 
aarne
Sr. Member
 
Total Posts:  130
Joined:  2007-09-06
 

Ok that helped, just first local cache screwed it still up. smile

Although for example with default template minifying css loses all background images. This is because in the css they are listed for example as follows:

.header-top-container { border-bottom:1px solid #415966; background:url(../images/header_top_container_bg.jpg) repeat-x 50% 0; }

After minifying that folder isn’t there anymore, because it tries to look for the image from for example:

/minify/1225924300/skin/frontend/default/default/images/header_top_container_bg.jpg

And the picture actually is in:

/skin/frontend/default/default/images/header_top_container_bg.jpg

Just a note to everyone with similar issue.

I imagine relative paths won’t work effectively with minifying so the path to image should be absolute, for example:

.header-top-container { border-bottom:1px solid #415966; background:url(/skin/frontend/default/default/images/header_top_container_bg.jpg) repeat-x 50% 0; }
 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 

The extension is supposed to change the relative paths into absolute paths for you.  For instance, in one of my css files I have this:

background:#f2f2f2 url(../images/body_bg.gif) 0 0 repeat;

But after viewing the minified version, it looks like this:

background:#f2f2f2 url(/skin/frontend/default/cvf/images/body_bg.gif) 0 0 repeat;

Is that not working for you?

 
Magento Community Magento Community
Magento Community
Magento Community
 
aarne
Sr. Member
 
Total Posts:  130
Joined:  2007-09-06
 

Nope, that doesn’t seem to work then. According to browser the image url actually changes to:

/minify/1225934353/skin/frontend/default/default/css/reset.css,skin/frontend/default/default/css/boxes.css,skin/frontend/default/default/css/clears.css,skin/frontend/default/default/css/menu.css,skin/frontend/default/default/css/skin/frontend/default/default/images/body_bg.gif

I wonder if some specific php module does the conversion, since I’ve tried to minimize the unnecessary modules. Tried to look for more info, but haven’t been able to locate yet.

Edit: actually the url changes to “skin/frontend/default/default/images/body_bg.gif”, thus missing the front /. That’s why the browser show the image url being like that. So the problem is only getting the first / into the CSS.

 
Magento Community Magento Community
Magento Community
Magento Community
 
FOOMAN
Guru
 
Avatar
Total Posts:  669
Joined:  2007-12-13
Auckland, New Zealand
 

@aarne- I’ve just uploaded a new version of the speedster extension. It incorporates the latest release from minify (2.1.1). Let me know if you still experience issues with the images and I’ll continue looking into it. It is a bit strange that some have the trailing / while others don’t.

@i960- thanks for your help in troubleshooting this - I’ve added a commented line in the distributed /lib/minify/.htaccess to disable zlib compression for the minify folder

@all - if you want to upgrade to the latest version (0.7.7) please note that validation-4min.js has been removed. Please change your page.xml back to the original validation.js

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 

So what was changed to allow the original validation.js to work?

 
Magento Community Magento Community
Magento Community
Magento Community
 
i960
Guru
 
Avatar
Total Posts:  633
Joined:  2007-10-01
Bakersfield, CA
 

It appears I still need to use validation-4min.js.  If I change it back, then all javascript stops working and I get this error:

PHP Fatal error:  Uncaught exception 'JSMinException' with message 'Unterminated string literal.' in D:\wwwroot\mydomain.com\lib\minify\lib\JSMin.php:99
 
Magento Community Magento Community
Magento Community
Magento Community
 
purplemine
Sr. Member
 
Total Posts:  143
Joined:  2008-05-20
London
 

I installed the Fooman Speedster module and it broke the product pages in the modern theme, the zoom tool no longer works, the menu dropdowns and the tabs at the bottom of the page for the product information are all not working.  I have uninstalled per instructions as a temporary measure and there seems to be no improvement.  Does the module change the original files?

Thanks,

John

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