We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

SL Combinator : Combine and Compress JavaScript and CSS on-the-fly : Version Update (2.1.0) 1st April, 2009

Development and Programming

lealea's avatar
lealea
202 posts
16 years ago
lealea's avatar lealea

Stephen, thanks for this great add-on. Appreciate it. One niggly suggestion though: I’d make the Document Root section of Minify default in future updates of this. I’ve already had to set it up on two completely different servers and sites. Each time the reason it wasn’t rendering was because I had to explicitly explain the document root. 😊

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Hi Lea,

One niggly suggestion though: I’d make the Document Root section of Minify default in future updates of this. I’ve already had to set it up on two completely different servers and sites. Each time the reason it wasn’t rendering was because I had to explicitly explain the document root.

I’m not quite following you… are you having problems with the DOCUMENT_ROOT definition inside Minify.php itself?

Stephen

       
lealea's avatar
lealea
202 posts
16 years ago
lealea's avatar lealea

I apologize. I was referencing this solution. When you add a section to the Minify config explicitly stating where the DOCUMENT_ROOT is manually.

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis
I was referencing this solution. When you add a section to the Minify config explicitly stating where the DOCUMENT_ROOT is manually.

I’d completely forgotten about that… I’m sure it was even on a long-since misplaced to-do list at some point.

Thanks for reminding me, I’ll make a note (somewhere safe) to address this in the next version.

Cheers, Stephen

       
Paul B's avatar
Paul B
241 posts
16 years ago
Paul B's avatar Paul B

I’m having a similar issue with the extension disabling my main stylesheet and I’m not sure I am following how the earlier poster solved his issue.

here’s my code:

{exp:sl_combinator:combine_css disable="no" debug="no"}
<link rel='stylesheet' type='text/css' media='all' href='{stylesheet=site_css/stylesheet}'/>  
{/exp:sl_combinator:combine_css}

Cheers, Paul

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Hi Paul,

I’m having a similar issue with the extension disabling my main stylesheet and I’m not sure I am following how the earlier poster solved his issue.

Sorry, which poster?

Stephen

       
Paul B's avatar
Paul B
241 posts
16 years ago
Paul B's avatar Paul B

Morning Stephen, they inspire on page 2. The only difference is that my stylesheet is not located on a sub domain.

Looks like I’ve got some troubleshooting to do … JS is also getting disabled.

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Hi Paul,

Ok, let’s walk back the cat shall we..?

  1. What is the output of SL Combinator?
  2. If [1] is a URL (like http://domain.com/utils/min/index.php?f=/css/screen.css, for example), what happens when you access that URL directly in your browser?

That should be enough to point us in the right direction.

Cheers, Stephen

       
Paul B's avatar
Paul B
241 posts
16 years ago
Paul B's avatar Paul B
“walk back the cat”?

http://www.[url].com/scripts/min/index.php?f=/css/screen.css returns

HTTP/1.0 400 Bad Request

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Walk back the cat:

To attempt to understand the true nature of a situation by reconstructing events chronologically from the present to the past.

I’ve been watching too many spy films.

Anyway, back to the problem at hand. I’m going to have to dig through the minify code a bit to see where the problem lies – expect me to pester you with more questions in the near future.

Cheers, Stephen

       
Paul B's avatar
Paul B
241 posts
16 years ago
Paul B's avatar Paul B

Well, I’ll grant you, it is far easier to say.

Let me know if you need me to provide any additional information.

P

       
birdie's avatar
birdie
68 posts
16 years ago
birdie's avatar birdie

Hi Stephen,

Thanks for a great extension, it’s made a huge difference to the download speeds on a site i’m working on. (Especially the CSS - 35k to 8k - Nice!)

I have run into a couple of problems with the javascript side, they aren’t deal breakers by any stretch but if you have any suggestions i’d love to hear them!

  1. Jquery: No matter what version of Jquery I use it doesn’t get processed, and breaks the remaining scripts too. I’ve tried the full version of 1.3.2 and the minified version with no luck. Because it’s quite large it would be great to get this down some more if possible, or even to just get it included in the single http request without compression would help.

  2. Cufon I’m using Cufon (http://cufon.shoqolate.com/generate/) to add a custom font on the site, which uses two files - cufon.yui.js (15k) for the processing and cufonfontname.js (50k - ouch!) which holds the font info. I’m not too concerned about these, but just in case someone else is using Cufon in the future and runs into trouble I thought i’d flag it here.

Thanks again for your work on this, very handy.

Cheers,

Cormac

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Hi birdie,

No matter what version of Jquery I use it doesn’t get processed, and breaks the remaining scripts too. I’ve tried the full version of 1.3.2 and the minified version with no luck. Because it’s quite large it would be great to get this down some more if possible, or even to just get it included in the single http request without compression would help.

Ok, let’s start with the obvious question: are all the scripts you’re requesting being served from your site (i.e. not a remote server, or a subdomain)?

Also, are you seeing any JavaScript errors when the scripts are compressed, or is everything just failing silently? If you have a URL I could look at, that might help.

That’ll do for starters.

Cheers, Stephen

       
birdie's avatar
birdie
68 posts
16 years ago
birdie's avatar birdie

Hi Stephen,

All the scripts are hosted on my website server, in a folder called “scripts”, there are no subdomains or anything like that involved.

Here is my sl tag, with all scripts except Cufon: http://skitch.com/birdie/bt6qm/head-scripts.php

(The forum removed my script tags so hopefully the image will do!)

I don’t get any errors when Jquery isn’t included.

When I add Jquery, however, I get a 400 Bad Request error. I can see the Jquery file if I look via the path though: http://mysite.com/utils/min/index.php?f=scripts/jquery-1.3.2.min.js&debug=1

I am using the include method to remove index.php, in case that has anything to do with it, here is my .htaccess content:

RewriteEngine On
RewriteCond $1 ^(member|includes|site|info|work|about|clients|blog|contact|quote|P[0-9]{2,8}) [NC]
RewriteRule ^(.*)$ /index.php/$1 [L]

I’ll PM you a link to the site so you can take a look, and will leave it with jquery included so you can see the error.

Thanks for your help with this, much appreciated!

Cormac

       
Stephen Lewis's avatar
Stephen Lewis
466 posts
16 years ago
Stephen Lewis's avatar Stephen Lewis

Hi Cormac,

Apologies for the delay in replying — far too many looming deadlines.

I’ve tracked down the problem (I think). By default Minify sets the maximum number of files that can be combined and compressed in one hit to 10 (I’m not entirely sure why).

You can either split the compressing into two batches, or open up the /utils/config.php file, and change this line:

$min_serveOptions['minApp']['maxFiles'] = 10;

I’d also recommend disabling debugging, unless you have a specific need for it, as it can (very occasionally) introduce JavaScript errors.

Let me know how that works out for you.

Cheers, Stephen

       
First 2 3 4 5 6 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.