Concrete On steroids

Permalink 26 users found helpful
This thread has been discontinued although it still contains a lot of valuable information. For the latest discussions on Miser, please post your questions in the thread:

"Miser - Website OptiMISER".
http://www.concrete5.org/community/forums/customizing_c5/miser-web-...


Concrete is a fantastic product. However. I nearly went elsewhere after a couple of days due to its reluctance to load pages. I commented on another thread how I had managed to get it to go faster. I had no reponse from anyone so I thought I'd share the actual code in the hope that it helps others as it did me. There is no warranty with this, so use at your own risk. It may also not be suitable for all sites that are heavily dependent on Concrete5s cahcheing system. But it's here non-the-less.

Attached are 4 files."View.php" (which you should place in your top level libraries directory), "dashboard.php" (which goes in your top level themes/core/ directory) and "header_required.php" + "footer_required.php"(which both go in your top level /elements directory). You won't be over-writing the core files so if you find it doesn't work for you, then can just delete them to go back. The CC5 team have implemented an excellent customisation system where you can modify the core files without actually modifying them - hats off to the team.

What do they do?
They basically sort the HTML headers (css, javascript and links) and minify the contents.

How does it work?
Any item that is added to the header (addHeaderItem) is inspected and sorted into a number of categories. If it is in-line CSS it is all concatenated together and minified. This then goes to the top of the header.

If it is a relative style-sheet, it is checked to see how big it is (on disk) and, if it's small, its added to the inline styles above. If it's big its added to another category. These are then output after the in-line CSS.

Exactly the same process happens happens with Javascript. However, the Javascript is moved to the footer (except for JQuery). The jQuery is also obtained from the Google Content Delivery Network.

All the above is achieved in View.php on its own.However, to get some javascript to the bottom when in Admin mode, the other files are required which move around some hard-coded javascript to enable them to be sorted in the header. There are other hard-coded javascript dotted around the core, but for simplicity I've only supplied these.
---------------------------->>>
The final bit of the optimisation process (after putting the files in) requires adding some lines to the .htacess. If you don't know what that is. Then don't do the next bit.

This will sort out the expires times and enable gzip compression (if not already active) meaning much more of your static content will be cached in the users' browser and everything will be GZipped - making YSlow happier. The above changes mean that the site will "seem" to load much faster on the first visit. The next bit means that the second visit (and while they are going from page to page) will be relatively instant.
<IfModule mod_deflate.c>
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
<IfModule mod_expires.c>
<IfModule mod_headers.c>
Header unset Pragma


If you like this article (and it works for you) then I will post the super steroid version (once I've finished it)

Phallanx
 
adamjohnson replied on at Permalink Reply
adamjohnson
This looks cool. I'll give it a whirl and let you know how it goes.

Quick question: do expires headers need to be enabled on the server (like Gzip) or can they be used no matter what?
Phallanx replied on at Permalink Reply
Phallanx
Like most things in Apache. Expires headers are handled by a module (mod_expires). So yes. It needs to be enabled. I believe it's part of the default install so unless your hosting provider has specifically turned it off (haven't come across one yet) then it should already be enabled.
dunamis replied on at Permalink Reply
Im getting frustrated with this.. its slow and choppy and now my webpage has disappeared.. says its down for maintenance.. but it isn't.. this is taking forever all I want to do is go live.. how do I post in forums? the smooth graphics on this CMS are deceiving cause there is nothing smooth about his process!!!!
zoinks replied on at Permalink Reply
Is your website slow and choppy with the new C5.5? I have upgraded 3 sites and installed it fresh and I am amazed with the speed improvements! It's lightning fast. Upgrade is pretty simple, too.
okapi replied on at Permalink Reply
okapi
I can confirm that. Even on a shared host Concrete5.5.2.1 performs much better than any previous version. Even the annoying first page load delay seems to have vanished away.
adamjohnson replied on at Permalink Reply 3 Attachments
adamjohnson
Phallanx,

I got to test this out athttp://hp.ajdwv.com (a test site) and I can definitely notice the difference in speed (very likely due to ordering of CSS & Scripts appropriately!). Totally night and day.

On the front end, everything appears to be all good. I can sign in and see the edit bar, my site, put a page in edit mode--all fine.

The issue I ran into was when I tried to edit a block, I was directed to a new page (see screen shots)--essentially breaking editing.

If you view source, you can see in the footer there is a style tag that should probably be a script tag. Here it is:

<style type="text/css">// cannot rely on jQuery being loaded here var ccm_uiLoaded = false;var ccm_siteActivated = true;var ccm_animEffects = false;ccm_parseJSON = function(resp,onNoError){if (resp.error){alert(resp.message);}else{onNoError();}}ccm_deactivateSite = function(onDone){if (ccm_siteActivated == false){return false;}if ($("#ccm-overlay").length < 1){$(document.body).append('<div id="ccm-overlay"></div>');}$("embed,object").each(function(){$(this).attr('ccm-style-old-visibility',$(this).css('visibility'));$(this).css('visibility','hidden');});if (ccm_animEffects){$("#ccm-overlay").fadeIn(100);}else{$("#ccm-overlay").show();}ccm_siteActivated = false;if (typeof onDone == 'function'){onDone();}}ccm_activateSite = function(){if (ccm_animEffects){$("#ccm-overlay").fadeOut(100);}else{$("#ccm-overlay").hide();}$("embed,object").each(function(){$(this).css('visibility',$(this).attr('ccm-style-old-visibility'));});ccm_siteActivated = true;ccm_topPaneDeactivated = false;}ccm_addHeaderItem = function(item,type){if (type == 'CSS'){if (!($('head').children('link[href*=' + item + ']').length)){$('head').append('<link rel="stylesheet" type="text/css" href="' + item + '?ts=' + new Date().getTime() + '" />');}}else if (type == 'JAVASCRIPT'){if (!($('head').children('script[src*=' + item + ']').length)){$('head').append('<script type="text/javascript" src="' + item + '?ts=' + new Date().getTime() + '"></script>');}}}// called in versions popup ccm_disableLinks = function(){td = document.createElement("DIV");td.style.position = "absolute";td.style.top = "0px";td.style.left = "0px";td.style.width = "100%";td.style.height = "100%";td.style.zIndex = "1000";document.body.appendChild(td);}</style>


My guess is this is what is causing editing to bonk (if you have the sitemap & file manager buttons enabled for the edit bar, those break too). Thoughts?

Great job on putting this together. I think this is super key for Concrete5 to do (all you have to do is see the difference in loading a page before & after). Hopefully we can get this style/script tag sorted out.
Phallanx replied on at Permalink Reply
Phallanx
Good catch.

Try this modified View.php and see if it resolves your issue.
adamjohnson replied on at Permalink Reply 1 Attachment
adamjohnson
Looks better here. I can now edit content, etc; however, when I go to add/edit, I get the "loading" image (see screen shot) until I hit cancel & exit edit mode.

After I exit edit mode, the content is there; however, I never got the "Publish Content" screen & therefore there's the "Approve this version" dialog in the upper right.

Thoughts? Is this happening in anyone else's case?
adamjohnson replied on at Permalink Reply 1 Attachment
adamjohnson
Seems to disable the tab functionality in some of the blocks as well. Again, see the screen shot for an example.
Mnkras replied on at Permalink Reply
Mnkras
If you have a VPS or Dedicated i suggest mod_pagespeed by google, basically does most of that.
adamjohnson replied on at Permalink Reply
adamjohnson
I should add that the site above which I am testing this with is on shared hosting with Hostpapa. http://hp.ajdwv.com .

Mnkras, weren't you working on something similar to this for a future release (for those of us without a VPS/Dedicated box)?
Mnkras replied on at Permalink Reply
Mnkras
Yea I was, the problem I was having was that the generation caused too much overhead. When I get some free time I'll look into it again,
Phallanx replied on at Permalink Reply
Phallanx
Nope. I'm a cheap charlie :)
Shotster replied on at Permalink Reply
Shotster
> If you have a VPS or Dedicated i suggest mod_pagespeed
> by google, basically does most of that.

FWIW, a VPS or dedicated server is not necessarily required to use mod_pagespeed. DreamHost, for instance, has a simple checkbox to enable or disable it at will. The beta version did not work with C5. I've not tried it since, but others have reported success with other hosting providers.

-Steve
Phallanx replied on at Permalink Reply
Phallanx
Damn. Google changed their API to 1.5 over the last 48hrs :( Nasty

Change the line (in View.php):

print '<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>';

to
print '<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>';

It should be ok now.
adamjohnson replied on at Permalink Reply
adamjohnson
Did that in the first version, but not in the second.

As far as I can tell, everything seems to be responding pretty well to these modifications. The only things that I notice are that flash (specifically, the YouTube block) displays "You must install flash to view this content) & the Date Navigation block is borked.

YouTube block:
http://hp.ajdwv.com

Date Nav block:
http://hp.ajdwv.com/index.php/blog/test-post-with-some-content/...
Phallanx replied on at Permalink Reply
Phallanx
You should do it in the second since there is a change in the regex to remove "\\" comments from javascript (the issue you pointed out first).

Looking at your site in FF3.6 and Chrome. Everything looks good. No problem with the swf and the date nav looks properly formatted.

If you are happy after that I will upload the full set again with all the changes.

I don't think you have implemented the htaccess mod since your images are not being cached and not everything is Gzipped. That will reduce your second load by about another 30%

I really appreciate your persistence with this. And it is worth it. I've also learnt my lesson with Google CDN :)
Phallanx replied on at Permalink Reply
Phallanx
Further thought. Maybe you should clear your browser and Concrete5 cache. (You can even turn off the CC5 cache now since you have a static site and I get better performance with it off)
adamjohnson replied on at Permalink Reply 1 Attachment
adamjohnson
Cleared both my browser's cache & Concrete5's cache and it didn't seem to fix the flash/date nav issue. Looks like the site statistics in the dashboard display the same message (see screenshot). Wonder what's going on with this...

Just tried adding the expires headers via htaccess & something got borked. I removed it for the time being and will look into that further tomorrow.
adamjohnson replied on at Permalink Reply 1 Attachment
adamjohnson
Changed my view.php to include the 1.4.4 jQuery.

So are you able to see & play the YouTube video? http://hp.ajdwv.com should have a YouTube video at the bottom that looks like this page: http://a2.adamjohnsondesign.com... . I cleared my cache and wasn't able to see the video.

I don't have Gzip available on my shared plan (Hostpapa & A2 don't have it on their shared plans as far as I can tell). I'll put the expires headers in there when I get a chance.

Really dig this mod. I'll keep playing with it on some other sites and see how it does.
Phallanx replied on at Permalink Reply
Phallanx
Ahhh. IC. I thought you were talking about something else; apologies.

Tha attched should play your yourtube and it has the other fixes. Let me know how it goes.
adamjohnson replied on at Permalink Reply
adamjohnson
Aha! Flash is back, but it looks like there's an error on line 228 of view.php when you are not signed in.
Phallanx replied on at Permalink Reply
Phallanx
Ahh. I'm obviously getting tired. Making silly mistakes.

change
print implode(' ',$hdrs);

to

print @implode(' ',$hdrs);

notive the "@" sign.
adamjohnson replied on at Permalink Reply
adamjohnson
Added the @ to both implode's on lines 227 & 228. Seems to get rid of the error.

Lookin' pretty good! I guess the only thing I can see not functioning normally at the moment is the date nav (it should expand & contract when clicked): http://hp.ajdwv.com/index.php/blog/...

I wonder if this is from the way the JS is written? Not sure. More in the AM.
Phallanx replied on at Permalink Reply
Phallanx
Yup. I need sleep. The caffein isn't working any more :)

I'll get back to it tomorrow. Again thanks for all your testing. Well worth a mention in the documentations !
jleinbaugh replied on at Permalink Reply
jleinbaugh
I plan on playing around with the code this afternoon. Migrating my church site over to C5, but was nervous about the page loads. Thanks for your efforts and I'll post feedback later today.
Phallanx replied on at Permalink Reply
Phallanx
Post any problems and I'll see what I can do.
Phallanx replied on at Permalink Reply
Phallanx
Ok. Attached is the latest mod < embarrassed smile>.

You tubes working. Date navs working editing is working (as far as I can tell).

Let me know hoe you get on.

I think it would be useful for other readers if anyone brave enough to try the mod could post before and after benchmarks so we can really see if it's worth it. I like thehttp://www.webpagetest.org/ for it's detail, but I think just the Load Time, First Byte and Start Render are sufficient.
12345j replied on at Permalink Reply
12345j
this looks great. Ill test it out.
12345j replied on at Permalink Reply 1 Attachment
12345j
one thing i noticed quickly- it seems like the hover state for the menu bar and the popup in edit mode when you click on a block are gone- see image.
adamjohnson replied on at Permalink Reply
adamjohnson
I see the same thing that 12345j is seeing with the hover states disappearing in the popup in edit mode.

Date nav functionality works now; however, the arrows appear to be missing. Also, I have installed the "Fancy Forms Template" add on for the About page (same as "Site Feedback" button on C5 when your logged in) & the image for the button is missing. My guess is that this is the same issue we're seeing with the arrows on the date nav & hover background in the edit popup (all CSS background images).

I just tested the mod on my test site and found:

Without the mod, the About page loaded in 5.512 seconds @ 227kb.

With the mod, the About page loaded in 5.167 seconds @ 234kb.

W/O mod, the Blog page loaded in 3.933 seconds @ 406kb

With the mod, the Blog page loaded in 3.717 seconds @ 407kb.

I cleared the C5 cache before each test. Also, I don't have any expires headers in htaccess.

The question, "Is it worth it?". I would say definitely. Even if the page load doesn't go from 5 seconds to 1 second, the site is giving the user visual feedback while assets are being downloaded. Currently, (without this mod) all of those script tags in the head block the rest of the page from loading. With this mod, users will see content while those scripts are loading; thereby, making it seem faster.

In essence, seeing a flash of partially loaded content is better than seeing a white screen while the page is loading.

I'm curious to see & hear what others think.
12345j replied on at Permalink Reply
12345j
i saw something similar- even though you couldn't "interact" with the page for a similar amount of time you could still read the content above the fold, and by the time your done the rest should have loaded. I also noticed that the load for edit mode is a lot faster. Ill post some times later.
Phallanx replied on at Permalink Reply
Phallanx
OK. I need to to replace the relative URLs im the style sheets. Leave it with me while I work out the solution.

The difference in performance will vary depending on the contents of the page. This is why I talked about Load Time, First Byte and Start Render.

First byte is basically how long it takes to do a DNS lookup and for your server to respond with some data. This wont improve as result of applying the scripts as it is dictated by the network, your server hardware and congestion.

Start Render is when the browser starts to compose the page to the user. This we are very interested in and we are looking for the difference between the First byte and Start Render. The script should make a huge difference here since, instead of waiting for everything to be downloaded, the browser can start creating the page. This is what you are anecdotally seeing, but with these two metrics we can quantify it.

The Load Time will improve a bit. It is very dependent on:
1. Content from your site (number of style-sheets/javascript, images, page size etc).
2. Content from other sites (e.g YourFace, MyTube, Goggles etc).

No.1 we can improve. No2 we can't. We can only try to make sure that No2 doesn't interfere with No1 (so that the browser can get to work as soon as possible) and give the user something to do instead of looking at a blank page.

It's worth me mentioning at this point caching.

CC5 has a cache system. Great. But out goal is not to use it. Rather than get content cached on our server, which might be a long way from the user. It is much better to cache in the users browser and in remote caches closer to the user. This is what the expiry times for the htaccess is for.

The CC5 team have done a great job of including some of it in their code. But it's a trade-off between the way CC5 works for the general populace. If you have a content rich dynamic site with lots of externally hosted content, then the htaccess mod won't do much for you (neither will the CC5 cache). If however you have a fairly static site with images, text and locally hosted content. Then the mod will make a big difference (more than the CC5 cache). If you are somewhere in-between then the mod will enhance CC5 caching capabilities by not burdening the CC5 code with checking for freshness on static content. It also makes the static content more attractive to external caches and browsers. So after the first time of visiting a web-site, more is allowed to be cached in the users browser meaning less is downloaded from our server regardless if it is in the CC5 cache or not.
adamjohnson replied on at Permalink Reply
adamjohnson
Interesting stuff. I hadn't considered first byte & start render before. I'll keep those in mind for future tests. Thanks for the info.

Ran across this a while back:

http://www.onehat.com/blog/2010/03/concrete5-mod-moving-js-to-the-b...

Scott approached this differently (requires the modification of the way blocks call script's, etc), so it seemed more difficult for me to future proof IMO. In any case, I put a zip of the code for easy downloading at https://docs.google.com/leaf?id=0Bz5i6n1THnPDYTI3ZTA5NDEtZjMzYi00MDI... .

I'm excited to see the next rendition of this mod. Keep us posted!
Phallanx replied on at Permalink Reply
Phallanx
Yup. I like his mod. Much more integrated (professional ;) ) than mine. But it cannot sort the headers and requires you to go through all the core files files and change lots of stuff to take advantage of it. It also requires you to know what you can and cant in-line and decide on which options you will use. I just want something that will just do it (preferably in 1 file) on everything.

I also noticed that there is V2 html helper distributed with CC5 (although it isn't used) which is identical, so it looks like it will become part of the core in the future.

I looked at modifying Scotts version, but as it turns out, although you can in theory sort in there, you can't combine until you are in the header output. This means that when I go from this implementation to the aggregated one (nothing will be in-line) all the code will end up in the header output anyway.

Attached is the next iteration. It fixes all the style sheets but I still haven't figured out why the top-bar buttons don't mouse-over after showing the editing dialogue (small price to pay IMHO). It's something to do with the overlay - but what don't know.....yet. It's strange because the buttons on the right-hand side are fine. And they are fine before you open the dialogue. Just after they stop mousing-over (but they still work).
adamjohnson replied on at Permalink Reply
adamjohnson
I've added this new view.php to my test site. I'm planning on adding a bunch of blocks (both from the core & third party) to the site to see how everything performs later tonight. I'll also see what I can find out about the hover states. Looking better and better every day!
Phallanx replied on at Permalink Reply
Phallanx
Sweet. Let me know how it goes. I'll get round to the mouuse-over in a while.
adamjohnson replied on at Permalink Reply
adamjohnson
Tested this last night with most (if not all) of the default blocks included within the Concrete5 core. At first glance, everything appears to be working perfectly (no problems thus far). I also tested it against a bunch of other free & paid add ons and had almost no problems.

I say almost because I found 1 add on that didn't work with this. The ScalaIT Browser Update addon (via browser-update.org, already is last to load anyway no matter where you put it ). My solution was to simply uninstall the add on & manually place the script in my theme file. Simple fix.

Obviously, this is still in development but I thought I would include a link to a zip with the current files & brief instructions from above. Download them here:

https://docs.google.com/leaf?id=0Bz5i6n1THnPDZDY1MDk2N2ItMjgyNS00Nzc...

I'll try to keep this current.

EDIT:
Phallanx has posted a new & different approach to this 2 posts below. I'm going to leave the aforementioned zip up for posterity.
Phallanx replied on at Permalink Reply
Phallanx
Nice work. Many thanks.

I've also discovered a few other "quirks".

But the root cause is the same as the mouse-over. It's actually a script order dependency, but tracking down which one (or ones) need to follow which is time consuming without a dependency list (otherwise it'd be minutes).

I'll post more when I've cracked it.
Phallanx replied on at Permalink Reply
Phallanx
OK.
Here we are at the end of the week and you probably think I've forgotten about this. I haven't.

Attached is another version. You'll notice I say "ANOTHER" because it has gone through quite a metamorphoses during the week. The idea is the same. But now it uses a slightly different method as the other way was beginning to get a bit unmanageable and it wasn't very flexible. so I took on board what Andrew was saying and now it consists of a slightly modified View.php and a helper only.

To install.
DELETE all the old files from the previous incarnation of the optimiser that are in the top directories (View.php, dashboard.php, header_required.php and footer_reqired.php). they are no longer required.

There are only 2 files now. View.php which goes in the libraries directory and miser.php which goes in the "helpers" directory (I'm sure I don't need to tell you, but I will say it for the sake of others.....top level directories only).

This version is a bit sneaky. I've hooked the page render function this time and scrape the entire page picking out all the juicy bits even if they are in the document body. this means that it doesn't matter where any module writers of core files put their stuff; if we want it we've got it. It also now uses the JSMin Javascript minimiser rather than my home grown one since it's probably better and it's shipped with CC5.

In addition to all the previous stuff (linked style-sheets and in-line javascript in the header, google CDN etc) it also, now, finds and condenses styles and javascript in the body (It leaves goggles ad-sense JavaScript alone - they have to be there). And it finds the goggles tracking code and puts it to the header-but only if it's the asynchronous version.:)

The rewrite was necessary since I'm thinking of making options (give the user control over minfying etc) available in the Admin panel at some point and that wasn't feasible with the old method. since those days, I've also learnt a load about how it all fits together.

I looked at the mouse-over problem. It's Concrete5, not the mod. I deleted the whole installation (including the DB), re-installed a virgin copy and it did exactly the same.

So have a play and let me know how you get on.
jleinbaugh replied on at Permalink Reply
jleinbaugh
I'm really excited about your work as the sllloooowww initial page load of my C5 site is "almost" enough to make me abandon migrating over to C5. Just downloaded the new scripts and will play around this weekend. My question - is all the addition to .htaccess still needed? the expiration dates, etc. Or is the core pretty urls script all I need for .htaccess? (obviously I'm not a programmer!)
Phallanx replied on at Permalink Reply
Phallanx
Definitely needed.

As I mentioned before. The scripts will mean that your page "seems" to load faster by improving the wait between when the user first requests the page and it starting to show content.

The htaccess entries mean that more of your pages content will be saved to his browser and to servers closer to him/her. This means that AFTER their initial visit (when the caches are primed) much less content needs to be downloaded from you server since they already have it in their computer or a computer near to them.

It is needed because some of the settings in the cc5 core tell servers not to cache some content at all; preferring it's own cache to remote (or browser) ones.
jleinbaugh replied on at Permalink Reply
jleinbaugh
initial quick test (just loading the two files, clearing the cache and going) seems to work without any major glaring issues. One problem I'm experiencing (not being a programmer or web guru) is that PmwEncryptedEmail block is not working. (it's an email obfuscator) I assume it has javascript that needs to be loaded in the head, but I've no idea how to include it in the miser script.
Phallanx replied on at Permalink Reply
Phallanx
Whats your website?
jleinbaugh replied on at Permalink Reply
jleinbaugh
beta.theriverchurch.us
Phallanx replied on at Permalink Reply
Phallanx
Open miser.php in the helpers directory.

Locate around line 21:
$this->ignore_keys = array('google_ad');

Change it to :
$this->ignore_keys = array('google_ad','PMW.EEA');

See if that helps.


Ahh. Missed one!

You also probably need to change:

$this->top_Head_keys = array('date_nav.js',"ga.setAttribute('async', 'true')",'ga.async = true');

To

$this->top_Head_keys = array('eea.min.js','date_nav.js',"ga.setAttribute('async', 'true')",'ga.async = true');
jleinbaugh replied on at Permalink Reply
jleinbaugh
that seemed to do the trick! guess both lines needed changed!
Phallanx replied on at Permalink Reply
Phallanx
As Steve said. The file link needs to be in the head Also the individual sections need to be in the document (similar to goggles ads).

Soooo.

any difference? I'm guessing you've made the htaccess mods too ;)
Shotster replied on at Permalink Reply
Shotster
My EEA (encrypted email address) block uses JS's built-in document.write() method which generates output AS the page is being rendered. That means it simply won't work if the included JS file (upon which it depends) is being loaded at the end of the document.

That said, I plan to re-implement it in a way that should work regardless of where the included JS is loaded.

-Steve
Phallanx replied on at Permalink Reply
Phallanx
That'd be sweet.

The mod has the ability to ignore stuff (as well as define where it should be placed). It just isn't a sleek package at the moment so it has no presence in the Admin UI.

But my suggestion above should mean it gets ignored.
adamjohnson replied on at Permalink Reply
adamjohnson
Looks like the "Zoom Image" block is borked. That said, the site feedback/fancyforms template is back:

http://hp.ajdwv.com/index.php/about/...

Haven't found anything else out of the ordinary at first glance. I'll test more later tonight.

...As I was rolling through the site I kept thinking, "Damn, this thing is snappy!"

Excited to see what comes out on the next round. Excellent work fellas!
Phallanx replied on at Permalink Reply 1 Attachment
Phallanx
Zoom image is working for me on you site link (picture of the auto-nav editor)

Picture attached.
adamjohnson replied on at Permalink Reply 3 Attachments
adamjohnson
Aha, you are correct. Now it appears to work. Not sure what was going on there.

I just tried putting this on a site of mine and it looks like the it is inlining my entire "main.css" which is a 20kb stylesheet. When it did this, some things in the layout changed a bit (see screenshots w/ mod, source w/ mod, & default/correct layout). Not sure if this is just the way I have written those styles but it seemed odd. Also, it seems to have taken my IE stylesheets and put them somewhere (maybe it has put them in with the rest of the styles & that's why it looks slightly off...?).

Other thoughts?
Phallanx replied on at Permalink Reply
Phallanx
What's the website?

Did the scripts make a difference (even though it was a bit off)?
Phallanx replied on at Permalink Reply
Phallanx
See if this version resolves your style problem.

I'm now handling switches separately so if you have any more problems with style switches, it shouldn't be too hard to resolve.

I've also been optimising the optimiser...lol. It's now much faster and should not be as much of a burden on the server compared to the previous one (it wan't much anyway, but every little helps).

It's now also easy to add CDNS (well. Easy for me at any rate). So if you have any you want added to the default set; let me know. They are no longer hard-coded and it picks only those that are used on the page. So the more, the merrier.
adamjohnson replied on at Permalink Reply
adamjohnson
Shaun,

It looks like the if IE conditionals have remained intact; however, those IE statements should be below main.css (because main.css defines how the site should look, & those IE conditionals modify the layout for IE because IE blows ;-).

My typography.css still seems to be inlining itself (not sure if that was what you were going for, looks like it was left alone on hp.ajdwv.com).

Shouldn't the excluded JS files (like date nav, etc), be loaded after jQuery instead of before it?

Pages are loading quick! If you need more URL's to stuff on CDN, check out http://cachedcommons.org . A TON of libraries on the GitHub CDN. More to follow. Cheers!
Phallanx replied on at Permalink Reply
Phallanx
[quote]
It looks like the if IE conditionals have remained intact; however, those IE statements should be below main.css (because main.css defines how the site should look, & those IE conditionals modify the layout for IE because IE blows ;-).
[/quote]
Well. Thats just being lazy...lol. Only joking.
Best I can offer at this point is suggesting that your declare your main css file as the first line of your conditional statements like this:

<!--[if (IE)|(!IE)]> main.css <![endif]-->

That should mean that it gets moved along with the others maintaining the required order

[quote]
My typography.css still seems to be inlining itself (not sure if that was what you were going for, looks like it was left alone on hp.ajdwv.com).
[/quote]
There are many typography.css files in CC5 (every block has one for example). The one you are probably seeing is one that resides in the tools directory. Any others will be in-lined since they are usually only about 800 bytes long.

[quote]
Shouldn't the excluded JS files (like date nav, etc), be loaded after jQuery instead of before it?
[/quote]
Hmmm. Yes. Although for the date_nav I don't think it's a necessity (still works). Putting the jquery first is a precautionary measure because so many jquery plug-ins require it loaded first. As all other jquery files are loaded in the footer. That "should" happen anyway. But you never know. I will look into it

[quote]
Pages are loading quick! If you need more URL's to stuff on CDN, check outhttp://cachedcommons.org . A TON of libraries on the GitHub CDN. More to follow. Cheers!
[/quote]
Sweet. I'll take a look.

Don't forgethttp://www.webpagetest.org/ so we can see how much of a difference (if any) there is
Load Time, First Byte, Start Render - before and after ;o)
adamjohnson replied on at Permalink Reply 1 Attachment
adamjohnson
Here are some results from webpagetest.org. The most noticeable difference is in start render: with the mod, the start render time is cut in half! See attachment csv's for more info. Load time & first byte are similar with and without the mod; however, with the mod they are slightly faster still.

That typography.css file is a file that I created (not from the tools dir). The integration with TinyMCE wins over the slight performance gain (although it would be sweet to be able to call styles via main.css that are specifically for TinyMCE. ...much like the "customize xyz" comments. Different topic there).

Keep us posted with developments. Thanks again for all the hard work!
Phallanx replied on at Permalink Reply
Phallanx
Many thanks. Your persistence is most appreciated.

I'm not sure I know what you mean about TinyMCE. I have styles listed in the drop down list with the mod installed.

Is there something special I need to do to replicate the problem?
Mnkras replied on at Permalink Reply
Mnkras
Phallanx, on my version, i have everything working, except, when i stick all the js in 1 file, it produces js errors, but, i can have it minify files, i can add that in if you want,
Shotster replied on at Permalink Reply
Shotster
> when i stick all the js in 1 file, it produces js errors

But of course!

Even putting inline body scripts at the bottom of the document, as the version I have from Phallanx does, is going to cause problems. Whether it's good practice or not, lots of JS programmers RELY on certain scripts executing within a specific context and/or at a specific time during the page rendering process. You can't just "transplant" an INLINE body script without there being consequences for various add-ons and themes.

Don't get me wrong. I'm all in favor of minification, consolidation, and moving scripts to the end of the document, but INLINE scripts within the body of the document should really be left alone. I mean, they're more than likely at that specific point in the document for a reason.

I agree with the general philosophy of this optimization technique, but it seems to me that if this has any chance of being widely adopted and perhaps even integrated into the core, there needs to be a reasoned approach. I'd like to suggest the following...

If a script, whether inline or externally referenced, is added via the addHeaderItem() method, then it's fair game for minification, consolidation, and relocating to the end of the document, but even then, their order should be preserved. If the script is inline within the body, it shouldn't be touched.

There might be other considerations as well, but that's all that comes to mind at the moment.

-Steve
Mnkras replied on at Permalink Reply
Mnkras
Nono hehe

Im not that stupid :P

i don't include inline javascript in the file or minification ;)

It just includes .js files, the errors make no sense, and they only originate from c5 javascript, not anything else, if the person isn't logged it it works perfectly though :)
Mnkras replied on at Permalink Reply
Mnkras
and i keep the order, (just moved jquery ui just under jquery)
Phallanx replied on at Permalink Reply
Phallanx
@Mnkras.

Javascript is very, very fragile. You only have to look at it the wrong way and it'll bite you. If you use Chrome or Firefox (they are the only ones I know how to use :) ) then you can find the specific line and it should tell you what the problem is.

I have seen missing semicolons which seem to work fine until you remove a newline. But it could be anything. It's difficult to say without seeing and trying the code.
Shotster replied on at Permalink Reply
Shotster
> Javascript is very, very fragile. You only have to look at it the wrong way and it'll bite you.

My experience is quite the contrary! I'm often impressed with how robust it is - especially when using a framework like jQuery which transparently handles many browser-specific idiosyncrasies.

The only thing that regularly gives me trouble is IE - not as much as when I was supporting IE6, but still too much. In fact, I just spent an absurd amount of time on some ridiculous rendering anomaly in IE7 that resulted in white space inexplicably being gobbled up when inserting a DOM node. I solved it by injecting concatenated strings instead of inserting a DOM node. Every other browser on the planet worked just fine via node insertion! Go figure!

:-(

-Steve
Phallanx replied on at Permalink Reply
Phallanx
My experience is quite the opposite. I program in several different languages and JScript is by far the most unstable ESPECIALLY using 3rd party frameworks mainly due to the ease at which you can shoot yourself in the foot. Maybe the construct is stable. But the libraries aren't.

Examples.

I have a site that uses google maps to show earthquake and tornado activity.The maps have broken twice in the last 3 weeks without me touching anything. I've had to go in and disable a feature because the Maps API throws an error and borks my page for some inexplicable reason. All it is doing is reading a value and setting the scale.

I also commented somewhere else in this thread that I used the latest version of of the jquery from the google CDN instead of the CC5 shipped one (auto-update...great). When I was testing it was 1.4.4. Everything seemed fine so I gave it to riotaj. In between me testing and riotaj testing (48hrs) they updated it to 1.5.0. It didn'twork any-more. The fix was to explicitly select the 1.4.4 version instead of the "latest" version.

If you look around the CC5 teams posts on this site, You will see that they very, very carefully appraise any javascript updates to the core before updating (the shipped jquery is currently at 1.3.1 I think). And rightly so.

Sorry. Don'r mean to rant. :)
Shotster replied on at Permalink Reply
Shotster
> The fix was to explicitly select the 1.4.4 version instead of the "latest" version.

Of course. It only stands to reason if the framework you're using is changing behind the scenes that you are asking for trouble. It doesn't seem like a good idea to point to the "latest" on a production site. (FYI, C5 uses jQuery 1.4.2 in the latest release.)


> You will see that they very, very carefully appraise any javascript updates to the core before
> updating (the shipped jquery is currently at 1.3.1 I think). And rightly so.

Yes, that's pretty standard procedure for any framework - client-side or not.

-Steve
Mnkras replied on at Permalink Reply
Mnkras
yea, thats what iv been doing, its things like ccminit is not a function, and it freakin is, the js is loaded before its executed, its weird,
Shotster replied on at Permalink Reply
Shotster
> yea, thats what iv been doing, its things like ccminit is not
> a function, and it freakin is, the js is loaded before its
> executed, its weird,

In my experience, assuming the code is minified and the order has been preserved, that type of thing actually indicates a syntax error - something like one or more missing semicolons. The only reason there's no syntax error when unminified is that browsers are often [overly] tolerant of poor syntax. That is, they often assume an end of statement when they encounter a hard return, even if there was no semicolon there. I've seen this most frequently when function literals are defined. A semicolon is required to properly terminate the statement, but it's omitted (either inadvertently or because the programmer doesn't understand it's needed).

Anyway, the only sure fire way to avoid those pitfalls is a lint utility (or tons of experience and a keen eye).

-Steve
Mnkras replied on at Permalink Reply
Mnkras
It's really weird, I can minify the files individually and it works

On Feb 14, 2011 12:48 PM, "Concrete5 Community" <discussions@concretecms.com>
wrote:
Phallanx replied on at Permalink Reply
Phallanx
@Shotster

Couple of good points here.

1.
I don't see this mod as a value-added add-on that enhances CC5s features. I view it as a hack that attempts to fix a "perceived" problem with CC5's page generation that causes pages to be unresponsive. Rather than being adopted into the core. I would rather the CC5 team take on board some of the techniques and change the core renderer to make this mod obsolete. (They are extremely smart guys and will do a far better job than I have). As such, its more of a proof of concept that it can, and indeed does, make a difference, without anecdotal evidence - with real tests. So from that point of view (my hope is) this mod really has no future.

2.
I went down the add_headers route previously. I found even that had no guarantees. Also as I learnt more about how CC5 works. There are, in fact, very few modules (and virtually none from the core and the CC5 shipped modules) that cannot be re-organised and others "seem" to be rare exceptions at that.

Sure there maybe some modules that resist. But I now have a mechanism to deal with problematic ones (there's only 5 so far and 2 of those are goggles adverts).
My fear, however, is that if a module isn't well crafted, relies on in-line placement or isn't atomic or requires a file to already be loaded from the header rather than lazy loading (excepting JQuery of course). Then the benefits of the mod will be nullified. In that case, there is really no point in applying the mod but the mod will be blamed for not "optimising" the page.

I dare say there will be those that must be at specific places in the code and as long as they employ asynchronous techniques; shouldn't be a problem in terms of performance and can be added to the ignored list (goggles ads is one). But for those that don't it is a choice between using this mod or using the module and that is up to the web site owner as to which benefits them more.
Shotster replied on at Permalink Reply
Shotster
> I don't see this mod as a value-added add-on that enhances CC5s features.

Understood. I'd just like to see the most come from your efforts.

I guess my point is that folks will stumble upon this thread, be [rightly] impressed with what you've done, install the mod, and then complain to developers whose add-ons no longer work. There's the potential for developers to be asked (or perhaps even expected) to fix stuff that's not truly broken. I mean, if the mod works with "most" stuff, it's understandable how someone might perceive "something wrong" with an add-on that doesn't work.


> I would rather the CC5 team take on board some of the techniques and change
> the core renderer to make this mod obsolete.

That's what I meant - not necessarily that the mod itself would be integrated into the core as is. I'm just saying that if things are done a certain way, more of what you've done can be reused.


> My fear, however, is that if a module isn't well crafted, relies on in-line placement or isn't
> atomic or requires a file to already be loaded from the header rather than lazy loading
> (excepting JQuery of course).

It's impossible to predict what a developer might do or why in order to achieve some desired functionality. To my knowledge, there are no documented guidelines or best practices for client-side coding with C5.


> the mod will be blamed for not "optimising" the page.

In fact, it could well be the devlopers of add-ons which don't work with the mod who will be "blamed."

Hopefully, those who install the mod will know exactly what they are getting into and 6 months from now won't be wondering why the add-on they just installed doesn't work.

Anyway, thanks again for your efforts.

p.s. I stumbled upon this a while back. It seems relevant to this thread...

http://developer.yahoo.com/performance/rules.html...


-Steve
Phallanx replied on at Permalink Reply
Phallanx
[quote]
I guess my point is that folks will stumble upon this thread, be [rightly] impressed with what you've done, install the mod, and then complain to developers whose add-ons no longer work. There's the potential for developers to be asked (or perhaps even expected) to fix stuff that's not truly broken. I mean, if the mod works with "most" stuff, it's understandable how someone might perceive "something wrong" with an add-on that doesn't work.
[/quote]

I'm actually on both sides of this fence.
If it doesn't work they can always add it to one of the lists (move to top, ignore etc).

[quote]
That's what I meant - not necessarily that the mod itself would be integrated into the core as is. I'm just saying that if things are done a certain way, more of what you've done can be reused.
[/quote]

I think actually, in terms of code, very little can be re-used. To include it in the core in the "right" way would actually take quite a bit of changing of the way CC5 gathers and assembles pages. But thats up to the developers. They know their code. This mod is little more than a page scraper that, instead of scraping client side, scrapes on the server side.

[quote]
In fact, it could well be the devlopers of add-ons which don't work with the mod who will be "blamed."

Hopefully, those who install the mod will know exactly what they are getting into and 6 months from now won't be wondering why the add-on they just installed doesn't work.
[/quote]

Well. If it's still around and on sites in 6 months time, it's likely that the module writers sites already have it too or it's been eaten by the core...lol I can live in hope ;) You, as a module writer will know anyway just by looking at their web page source that it's there and the response will be "add it to the Miser exceptions list" and hope that they don't notice any difference in performance.

[quote]
p.s. I stumbled upon this a while back. It seems relevant to this thread...

http://developer.yahoo.com/performance/rules.html......
[/quote]

Indeed. That very document was the inspiration, and the premise on which it works.
frz replied on at Permalink Reply
frz
I know Andy is watching this thread and if there's improvements we can make to the order of things that don't break add-ons, we'll certainly be doing that in the core... it doesn't really matter if its dramatically faster or just the perception of being faster because of how it renders if it improves the user experience as a whole we're all for it.

PS: this thread is brutally long, you might consider changing your "View Replies" mode to chronological instead of threaded and it gets more manageable at a glance.
Mnkras replied on at Permalink Reply
Mnkras
Franz, can you add a last post button? That would me nice, also a way to
link to specific posts,

On Feb 14, 2011 10:54 AM, "Concrete5 Community" <discussions@concretecms.com>
wrote:
frz replied on at Permalink Reply
frz
what do you mean last post? Just sort by chronological and scroll down.

best wishes

Franz Maruna
CEO - concrete5.org
http://about.me/frz
Shotster replied on at Permalink Reply
Shotster
> Franz, can you add a last post button?

Do you mean the ability to "jump" to the end of the page? That might be handy, although a better alternative in my view would be the ability to sort the thread in reverse chronological order so that the latest posts are always at the top and minimal scrolling is required.

> That would me nice, also a way to link to specific posts,

Perhaps I don't understand your request, but isn't that already accomplished with the anchor tags and the fragment identifier in the URL?

-Steve
12345j replied on at Permalink Reply
12345j
yeah, but what if you don't know what the url is- maybe a link to this post button that shows the full url with the post id.
Shotster replied on at Permalink Reply
Shotster
> yeah, but what if you don't know what the url is- maybe a link to
> this post button that shows the full url with the post id.

Ahh I see, basically the same link you get by email when you subscribe to the thread, except that it would be incorporated into each post in the forum itself. Yes, good idea.

-Steve
12345j replied on at Permalink Reply
12345j
yeah, like that. Id also like the ability to expand collapse posts so you can hide them once done reading them- so you don't get distracted, like in long threads like this.
Phallanx replied on at Permalink Reply
Phallanx
Perhaps it might be better to request site related features in the concrete support rather than in this thread.
adamjohnson replied on at Permalink Reply
adamjohnson
@Phallanx:

You are 100% right. Even though my typography.css doesn't appear in the doc as it's own file, the styles still appear in the drop down & you can add & remove from that list by editing typography.css & uploading it via FTP.

Also, noticed in this version how the browser update script works, very nice. I just reinstalled the package.

I suppose the only thing that I am concerned about at this point is the IE conditional stylesheets. That said, it sounds like that issue is being addressed in the next version.

Are you and Mnkras collaborating? Mnkras, I'd be interested to see how you are approaching this. If you need help testing reply here or PM me.
Phallanx replied on at Permalink Reply
Phallanx
One more thought.

if you find at around line 170 in miser.php:

$size = @filesize( $path );

and change it to:

$size = FALSE; //@filesize( $path );

It will turn off the loading of small css files.

Give that a try and see if it is indeed the in-lining that is causing the effect with TinyMCE that you are seeing.
adamjohnson replied on at Permalink Reply
adamjohnson
Indeed this does make all the CSS files via add ons load as external .css files. My typography.css also appears with this change.

Question: if typography.css worked before this change (confirmed via my last post), why the change? Are you simply testing here?
Phallanx replied on at Permalink Reply
Phallanx
I think we posted at roughly the same time, so I was answering your previous comment and hadn't seen the other one where you said it was ok.

Like said, it takes me ages to find and reply in this format. And it's getting harder and harder the more people there are (and there arn't many...lol)
Phallanx replied on at Permalink Reply
Phallanx
@riotaj
The attached should ensure that the JQuery and date_nav are in the correct order.

I've also put the goggles analytics back to the bottom by default since it was making 1/2 second difference on the second page load (i.e affecting cached load times).

I'v made it switchable so if you really want it up the top, Let me know and I'll tell you where and what to change.
jleinbaugh replied on at Permalink Reply
jleinbaugh
woke up and saw the thread was busy last night! I uploaded the two new files (1.0.2) and see that a couple of things aren't working on my beta site. I'm using a hacked version of the Luminosity theme and it wasn't loading one of the css files

/* import stylesheets and hide from ie/mac \*/
@import url("960.css");
/* end import/hide */


It works if I copy the 960.css file into my main css file, but I don't know what the point of the import was...

secondly, my extended google map didn't load. Usual disclaimer, haven't played around with it yet, just overwrote the two files and checked out the site...
Shotster replied on at Permalink Reply
Shotster
Not that this impacts any code I've written or am writing, but in an effort to understand the rationale behind the optimization script, I'm curious...

What's the advantage/benefit of moving inline JS to the bottom? I mean, they're not blocking any HTTP requests or anything.

The other changes make perfect sense - i.e. reducing the number of externally referenced files, moving external scripts to the bottom, minification, etc. I'm just not grasping the benefit of relocating scripts that are part of the document itself.

Just trying to understand. Thanks for any insight you can provide.

-Steve
Shotster replied on at Permalink Reply
Shotster
Ok, never mind. I just tried the latest version, and I see inline scripts are no longer moved. (Should have done a little more research before posting. Sorry.)

EDIT: Ok, I haven't looked very closely at the code until now. I see that there are certain ignore keys set up, so inline scripts are in fact being processed unless explicitly ignored. So my question is, why?

-Steve
Phallanx replied on at Permalink Reply
Phallanx
@Shotster
They should be being moved. You have a web page?

Try putting something like the following in after the <body> tag.

<script type="text/javascript"> alert('hello js '); </script>

@riotaj
Ok. I'll take a look.

there is a list for scripts that require being in the header it's better to put them in the "top_Head_keys" instead of ignore list. Then they will get consolidated with the rest of the ones in the header.

$this->top_Head_keys = array( 'eea.min.js','date_nav.js' );
andrew replied on at Permalink Reply
andrew
First off - thanks for putting so much energy into this, and for being so responsive in the forums when responding to people posting about your solution. That makes it much easier to critique and offer feedback about.

Second – I really like the underlying idea here. We've wanted to do something like that for awhile, just haven't had a chance to. You can kind of see the beginning of it in the version 2 HTML helper, which we include in the core but don't officially support or use in the core (yet)

$v2 = Loader::helper('html/v2');

I'm not married to the approach of the v2 helper - it was a code submission that I included because I really like the idea of adding minification to JavaScript and CSS, and I like the idea of including some of the CSS inline (if it's small), etc... I also like the idea of including it in the footer as well, for page loads, however I have some thoughts:

1. I like the addFooterItem() method, and the inclusion of footer_required in the dashboard layout.
2. I am going to add another parameter to it like this:

if (!isset($disableTrackingCode) || $disableTrackingCode == false) {
   echo Config::get('SITE_TRACKING_CODE');
}
// not working yet
// print $this->outputFooterItems();


So that we can include it in the dashboard but not make google analytics hit the dashboard (or any other stat tracking service.), so I will call it like this in the dashboard theme:

<? Loader::element('footer_required', array('disableTrackingCode' => true)); ?>


3. I'd like all the calling of addHeaderItems() or addFooterItems() to actually happen from within the header, dashboard code or header_required.php, rather than happening within the view.php library.

4. I think too much is happening within the view library. I'd rather see more of that JavaScript and CSS magic like minification, CDN loading of jQuery, etc... happen from within the HTML and CSS classes (in the html helper) with some optional parameters, rather than all within the outputHeaderItems() call in the view. It just seems like it'd be more future-proof and organized a little better in that way.

Don't get me wrong - this is great and I really want to include some solutions for this type of stuff in the core that we actually ship (and not just in the version 2 of the HTML Helper that we don't actually use in the core) – I'm just wondering about the most elegant way of doing it.

Nice work – let's see if we can't get this included in the core.
Phallanx replied on at Permalink Reply
Phallanx
Thanks for jumping in on this Andrew. I know it looks a bit hacky (because it is :) ) I only installed CC5 a couple of weeks ago and know very little of the API and documentation is a little rare. So I was more interested in getting it working as a proof of concept rather than elegance. I stumbled upon a "node" in the code that I could exploit for what I had in mind - and ran with it.

As I have commented. I like Scotts solution, mainly because it is in the spirit of the design. I only discovered it after I had written most of my implementation and actually made a mod to his that enabled sorting. But it quickly started to lose cohesion since that point in the process is unaware of the overall scheme of things.

1.
The footer required that I added to the dashboard was really a necessity to get it to print when in edit mode - more luck than judgement. It took me a while to find :P In reality. I've abused the addHeaderItem as a convenient conduit to aggregate the CSS aand javascript since it is used by the core, addons, templates and pretty much evrything. You have probably noticed that I've been around the core finding all the hard-coded script tags and converted them to addHeaderItem.

2.
I'm all in favour of keeping Goggles out of my admin area. In fact. Just before I started to write this I was trying to hunt down the permissions objects to switch certain JS on and off when in edit mode. And one of them was to be Tracking.

3
Well there I think you are a victim of your own brilliance since the outputHeaders and outputFooters are right next to each other in a single file already (hence the reason I went there). I realise that "architecturally" it's not ideal. But everything that's needed is funnelled into the outputHeaders and (conveniently) the output footers is right next door. Perhaps another way of looking at it is we need a hook into the header AND footer printing since addon modules, templates and the core all need to put stuff in there. But you are the experts.

4.
I wouldn't go far as to say this mod is "core" material. It's just a mod. This is just a way for me to learn the layout and how it all works and fits together and at the same time get my site to load properly ;)

The ultimate goal is aggregation. 1 rel-style-sheet. 1 JS file. Then CC5 will really fly (it makes this mod look like a tortoise). Unfortunately. That requires fiddling with the cache (which I haven't gotten to yet) and a lot of ignorant assumptions about dependencies. However, I've been casting my beady eye over the css.php in the tools directory since that seems to have all the necessary bits and pieces I need to make it work.
bryanlewis replied on at Permalink Reply
bryanlewis
Is there a finalize version of this? I'd love to try it out when the kinks are worked out.

Meh, I'll wait for the c5 core to update.
Phallanx replied on at Permalink Reply
Phallanx
Well. If there was a finalised version then this thread would have finished I guess.

There's only one issue I know of. But the proof is in the pudding.

If you want to run web page load tests then you can run them onhttp://www.labview-tools.com. It's a fully functioning (small) site running the mod.
Shotster replied on at Permalink Reply
Shotster
> There's only one issue I know of.

Which is what? Or did you mention it in this thread and I missed it?

BTW, thanks for your efforts! I'm anxious to give this a try.

Regards,

-Steve
jleinbaugh replied on at Permalink Reply
jleinbaugh
Shotster - how interesting to see you here... I just posted above that encrypted email is the only thing that seems to be affected by the scripts... can't figure out how to deal with the eea.min.js script...
Shotster replied on at Permalink Reply
Shotster
Hi jleinbaugh,

Yep, and I know exactly why. Are you willing to try an updated version that should work? If so, I'll PM you when I have it ready.

-Steve
jleinbaugh replied on at Permalink Reply
jleinbaugh
that would be sweet! I also hacked up my employee profile block so that it would encrypt the email there. sure I did it wrong as the only way it would work was to include an EEA block somewhere on the same page (or maybe it just had to render the EEA block before it got to the employee block to load the script first)
Shotster replied on at Permalink Reply
Shotster
jleinbaugh, if you want to post the relevant code for your employee block over on my add-on's support page, I'd be glad to assist you there.

-Steve
Phallanx replied on at Permalink Reply
Phallanx
I thought you said you weren't a programmer....lol
Phallanx replied on at Permalink Reply
Phallanx
Mentioned it a couple of times

Mouse-Over.

But I've found out now it's not the mod since it exists on a fresh install.
Mnkras replied on at Permalink Reply
Mnkras
Phallanx, I have an almost totally working js minifier and combiner,

If you hop on IRC i can show you what I have got :) (uses google api and jsmin)

Ill be on after 5 EST
Phallanx replied on at Permalink Reply
Phallanx
I don't have IRC.

The new version uses jsmin which comes with CC5 (I think its the same as the goggles one-maybe a bit older).

But this version doesn't minify the files served via links-only those that are in the page. The core really needs to minify it's cached files and combine them as you are probably doing. The trick is how and where to hook into the core since that has all the mechanisms for locking and caching. That was the next thing on my list to apply the virtual crowbar on after this was proven.

Do you have an example in any repositories (git-hub, source-forge or the like) ?
Mnkras replied on at Permalink Reply
Mnkras
nope just on my test site,

what i do right now, is serialize the array then md5 it then save the file as js_md5jargonhere.js in the /files/cache directory, when a file is removed/added the js file is regenerated,

im going to work on css later, but that is a lot easier,

what i need to do is figure out how im going to tell if the files changed, (c5 version, package version?) i might also make a job to clear the cache, once the file is generated the site is a lot faster, i just need to weed out i18n_js and the page controls to make it work,

You should really try to get on irc, you can usehttp://webchat.freenode.net
(i think thats the url)
when i get the js part fully working ill stick it on github.
Phallanx replied on at Permalink Reply
Phallanx
I've already had a working prototype/proof of concept for both JavaScript and CSS (you are right...CSS is much easier-no dependencies). I went a slightly different route for generating the merged files. But I think probably you are further down the road to a complete solution for the JavaScript.

I didn't bother with all that MD5 hashing stuff. No point for what I needed to do and I figured that once I had found the bit in the core that already does all that and resolves the paths; I'd just hook into it (take a look at css.php in the tools directory).

Let me know when you've got some code to try and I'll give it a whirl.
Mnkras replied on at Permalink Reply
Mnkras
If i remember correctly, css.php in tools is only for $this->getStylesheet('something.css'); in themes, ill look it up when i get home,

where in the core did you find the stuff that makes it unique? the ?v=bunchorandomstuff ?

thats the same for all files, (i think its an md5 of the app version and the salt)

Mike
Phallanx replied on at Permalink Reply
Phallanx
I din't say unique. I just said "all that stuff"-lol. I was looking at the css.php (tools dir) because it has the cache check & save for css files. The core uses the file name, but I was using the page name but it didn't look too much effort to do something similar.

Is it just me or is it getting REALLY hard to follow this thread. I don't find this format easy at all. Maybe start a new one? What dya think?
Mnkras replied on at Permalink Reply
Mnkras
i thought about that, or using the cids, pagenames wouldn't work well in my mind,
/page
and
/something/page
same page name, i guess you can use the page path,
Phallanx replied on at Permalink Reply
Phallanx
Indeed.

The only reason I used the page name was that it easy to see what was for what what when viewing the files created on disk. If I forgot - which when happens when I'm switching between several browser tabs and file views - I only had to look at the page tile in the browser). And it was a simple, logical way to generate a file pertaining to that page.
Shotster replied on at Permalink Reply
Shotster
> (you are right...CSS is much easier-no dependencies)

Not in the same sense as JS, but there could well be order dependencies. I have no idea how this is viewed as far as CSS "best practices" go, but it's not uncommon for folks to conditionally load stylesheets which selectively override properties previously set in another style sheet.

Am I correct in assuming that your "juggling" of inline styles and external style sheets preserves their original order?

-Steve
Mnkras replied on at Permalink Reply
Mnkras
It all depends on addheaderitem's order,
Shotster replied on at Permalink Reply
Shotster
That certainly isn't clear from Phallanx's description in the original post...

> If it is a relative style-sheet, it is checked to see how big
> it is (on disk) and, if it's small, its added to the inline styles
> above. If it's big its added to another category. These are
> then output after the in-line CSS.

That implies that a small externally-referenced style sheet could potentially wind up with the inline styles and thus NOT in the intended order.

-Steve
Phallanx replied on at Permalink Reply
Phallanx
Yes and no.

Generally, it is preserved in the sense that sheet links are processed top-to bottom and moved as a block and in-line styles are processed in the order that they appear on the page.

However, for relative links to small files (<4k) they are converted to in-line and added to the rest of the in-line styles so they are actually moved up above the position they would normally be loaded.

The issue with doing this is the same as dealing with @import tags. When a rel-style is converted, the path of relative urls (like images) no longer resolves to the directory that the original file resided in. To get round this problem, the CSS processing replaces all url declarations (that should include @import tags if I got my regex right) with a fully qualified path from the root. So css importing "should" work fine whether it is by a selector or defined explicitly.
Shotster replied on at Permalink Reply
Shotster
> However, for relative links to small files (<4k) they are
> converted to in-line and added to the rest of the in-line
> styles so they are actually moved up above the position
> they would normally be loaded.

But most overrides are in fact small CSS files which tweak the layout for a particular page, so this would be a concern it seems.

-Steve
Phallanx replied on at Permalink Reply
Phallanx
Well. If they are only called from within a css file, then the optimizer will not know about it and therefore not convert. If it is in the rel-styles, then it would have been loaded by the browser anyway.

If you have a specific example where it's causing a problem, I'll take a look and see what I can do.
Shotster replied on at Permalink Reply
Shotster
Also, by way of feedback, the part that removes double line breaks (around line 219) is a bit overzealous by eliminating them entirely. If, for instance, there is an inline script with a comment line followed by a blank line and then some code, eliminating both breaks causes the line of code to move up to the comment line, effectively commenting it out. Better might be to replace 2 or more breaks with a single break.

Best, IMO, is simply not to mess with inline scripts. That's a can of worms in my view.

-Steve
Phallanx replied on at Permalink Reply
Phallanx
@Shotster
I had a lot of problems with detecting and removing "//". with regex (still all looks like Klingon to me). Since CDATA also uses it......sometimes it got very complex, very quickly. If you have a suggestion for the regex ; I'm all ears;)
[I beleive minify removes "//" anyway.]

What you see is a work-around just to clean up a bit because the string deletion function doesn't remove the new line char when it deletes a line. But I'm aware of the implications, just haven't come across a real scenario as yet. When I revisit the deletion function, it won't be required.
jleinbaugh replied on at Permalink Reply
jleinbaugh
just wanted to say thanks for all your hard work! it's making the site [at least SEEM] considerably faster. No worries about going live with the site now. Thanks again, look forward to more improvements.
Phallanx replied on at Permalink Reply
Phallanx
Sweet.

Don't forget to run :

http://www.webpagetest.org/

Both with and without the mod and post the Load Time, First Byte, Start Render for cached and un-cached for us to see.

Your site is quite heavy on jquery That's a good thing for me since I can find more CDNS to include.
jleinbaugh replied on at Permalink Reply
jleinbaugh
not sure what you mean about heavy jquery... am I doing something wrong or just have too many blocks? is there something I need to do?
jleinbaugh replied on at Permalink Reply
jleinbaugh
Finally got around to running benchmarks... hope I did this right for you...

Without Miser
First View
LT 9.696s FB 2.758s SR 4.526s PSS 81/100
Repeat View
LT 1.535s FB 1.325s SR 1.547s

http://www.webpagetest.org/result/110307_PP_3TP6/1/details/...

With Miser
First View
LT 8.254s FB 1.511s SR 2.019s PSS 90/100
Repeat View
LT 1.532s FB 1.326s SR 1.544s

http://www.webpagetest.org/result/110307_BH_3TPS/1/details/...

Getting an A on everything except F on compress images and use of CDN
Phallanx replied on at Permalink Reply
Phallanx
Sweet.

Posted perfectly :)

Start render reduced from 1.7 to 0.5 secs.

I'd say that was working. Is the CC5 cache off or on?

I wouldn't worry about the CDNS showing F. It's just complaining because all your images are on your own site rather than a known content delivery network. The compress images is it's way of nagging that you could squeeze a little bit more from your images file size. Again. Ignore it - it's just being an old woman.
jleinbaugh replied on at Permalink Reply
jleinbaugh
cache is turned off. you need me to turn it on and try? I got the impression from the thread that you prefer it off...
Phallanx replied on at Permalink Reply
Phallanx
Nope. Off is good. Just checking.
Phallanx replied on at Permalink Reply
Phallanx
riotaj has posted some benchmark results (many thanks - superb work). If you scroll up the page (somewhere) you can download the results to make sure I haven't made any mistakes.

There's a lot of information in there so I thought you might like the abridged version and analysis of the results as to what they actually mean.

If you are not a geek....look away now :)

The three times we are interested in are
Time to First Byte (ms), Time to Start Render (ms) and Load Time (ms) - ms = milliseconds. Results will be presented in that order, in two rows - the first being without the browser cache primed (filled) and the second, with. Note that I say "browser cache". This IS NOT the same as the CC5 cache.

Below are the results for CC5 without the mod.
1540 4822 5247
1468 3335 3327

The Time To First Byte is basically how long it took for the server to respond to the browsers original request and start to send data. So, from the first row (no cache), it took 1540 ms (1.54 seconds) for the server to start sending.

The Time To Start Render (4822) is the point at which the browser has enough information to be able to start creating the page for the user/viewer. So we can see that the browser had sufficient information after 4.822 seconds. That is 3.282 seconds after the server sent the first byte

The Load Time is when the page has been fully rendered with all the pictures, adverts, widgets etc,and the browser is idle with nothing more to do. This is 5.2 seconds after the page was originally requested or 0.425 seconds after the browser started to render the page.

What does this mean?

It means that the viewer waited 4.8 seconds before anything happened after clicking on the link to the page, then everything happened in 0.4 seconds.

Following are the results with the mod.
The same format but I've appended the time differences that I stated before so there are an extra 2 columns on the end.

1485 2358 5057 873 2699
1461 1894 3298 433 1404

So now, with the mod, the time to the first byte is about the same. (1.485 seconds). We cannot do much about that except to pay for better hardware since it's down to the network and server hardware etc.

The time at which the browser has enough information to begin displaying some content is now only 2.358 seconds after the viewer clicked on the link. That's only 0.8s after the first byte was received in contrast to the previous 3.2. So the viewer is seeing something happening after 2.3 seconds as opposed to 4.8 seconds.

The time for the page to finish loading is about the same (~5seconds) but for 2.699 seconds it's actually showing more and more of the page (as opposed to not showing anything).

It is this that makes the site seem more responsive and enhances the viewers experience of your website. The viewer is actually looking at your page content being constructed and identifying the parts he is interested in looking at as they appear. In extreme cases of network lag (for example your server is in the US and the viewer is in New Zealand) he/she might give up before ever seeing 1 bit of your page if nothing is displayed until the final moment. If the viewer is watching the page being constructed, then they are willing to wait longer and will begin to read your content before it is finished. This they cannot do if the browser has to wait until the last 1/2 second.

I hope that explains what the mod is trying to achieve and what the numbers mean. If you use it, then please post your times here so we can all see them. If you would like an explanation of the cache times and/or the htaccess changes then just say so. But, if you are still reading, then I think I have probably bored you enough for one post.
xclydes replied on at Permalink Reply
xclydes
I must admit this mod seems really interesting, I am yet to give it a try but I will be sure to do so.
Looking at a few of the posts a few ideas have crossed my mind.

In reading I have noticed there seems to be a problem with the location of scripts, and the dependency of one block of code on another.

* This is an issue I had come across with an addon I have been working on. The best method I have thought of to date is to have a weighting system to manage the positioning of items in the final single file. That is something I am still working on. I don't know if you might be able to employ such a strategy.
OR
* Assuming all the files are referenced in the final document (to be sent to the browser, based on experience one case when it isn't so is tinymce), you could use php's wonderful inbuilt regex to identify and strip code and references to code. firstly blocks of inline code (might get a little tricky with 'onclick="$(this)"' style code) could be stripped and stored to a single string. Next tags could be selected and each 'src' tag checked to see if it is a file local to the site, or if it is one that can be captured via curl, and processed accordingly.
Once all the stripping and minifying has taken place, append the tag at the end of the document, just like would have been done otherwise.

I understand the usage of the .htacess file to apply server specific compression and so on, but I am pretty sure strings can be compressed in php and special headers applied, I need to do some research to confirm what I have in mind.

None the less, this add-on does look solid in terms of what it brings to the table, maybe with some more field testing it can be streamlined to make it easier to implement.

@Mnkras
what i need to do is figure out how im going to tell if the files changed, (c5 version, package version?)

I found that filemtime works pretty well. Sometimes better than expected.
$last_modified = filemtime($abs_filename);         if($last_modified >= $newer_than){
   //The file is unchanged, use the cached version.
}else{
   //The file is newer, regenerate the cached file.
}


Dunno if that can be of any help to you. Its based on the flat_file_cache class I was working on.
adamjohnson replied on at Permalink Reply
adamjohnson
Welcome to the party xclydes!

A note about .htaccess expires headers and gzip:
I looked in to both of these on 2 different shared hosting environments & it seems both hosts have these features disabled on their shared plans. When I tried to add them I got a 500 internal server error when visiting all pages of the sites I tested it on. They (of course) told me to get a VPS to enable these features.

...Not sure if this relates any to what you're talking about in php (I dunno obviously), but just thought I would throw in my .02 cents.
Phallanx replied on at Permalink Reply
Phallanx
Indeed. I will post a version that includes the module checks so at at least if people blindly put it in, it won't give a server error if it's not enabled.

I only expected technical personnel to try it since you really need to know what you are doing otherwise you can completely screw your site.

Keep looking. They are around. You might have to pay a little bit more, but you definately don't need a VPS, Just a decent provider. I usehttp://www.hasweb.com/ but I've been with them 6 years so it might be worth asking the question again to make sure their policies haven't changed.
Phallanx replied on at Permalink Reply
Phallanx
Hi xclydes.

I've seen your utilities (very impressive)- they are a bit over my head I think.

The order of the JS files (those with a link) is really only an issue if I move to consolidating into a single file (which I currently don't do). As the current mod processes the page after the renderer has composed it in it's entirety; I have the order in which they appear on the page so it's just a case of picking them out and grouping them together - preserving the original order (note that I'm ignoring in-line in this part of the discussion). That's pretty much all it does. I do a bit of fiddling by allowing JQuery to load in the header since I know for sure it is asynchronous (if loaded from the CDN). But apart from that. I do very little aside from moving them after to the bottom.

The next logical step for me is to extrapolate that to a single file, again with the fore-knowledge of the order of the links (which would just become includes in a single php file).

I have had a working POC which basically injects a single link to the page on place of all the original links and created a simple PHP consisting of a list of includes - allowing the server to do the rest.

Of course. This means no minification takes place. For that I'm looking to the core to see if I can "persuade" it (as I have persuaded the renderer) to save the cached files minified, which could then be automagically included by my generated file. This would mean that I would not have to manage freshness and regeneration of a multitude of files, only one. But thats further down the road and hopefully the work Mnkras is doing will mean I don't have to ;)

--------------
It is a bit rough around the edges. I've sort of been learning as I go having only installed CC5 a few weeks ago for the first time ever. So it's been a steep learning curve figuring out how it all fits together and what the sub-systems actually do and at the same time trying to get it to be more responsive.

I recently re-wrote the code from it's original form to allow features to be turned on and off with the view that at some stage I would get round to writing an Admin front end/ package (now that people are reporting favourable results). Even 2 weeks ago it wasn't guaranteed and only tested in anger on a single small small site - but in principle it should have worked and it seems to. I just need more benchmarks across a variety of different sites to be confident that it is robust before moving to the next stage (time permitting).
Mnkras replied on at Permalink Reply
Mnkras
What i was thinking, was getting all the package versions and the app version, and MD5ing that,
fastcrash replied on at Permalink Reply
fastcrash
woow..! this thread have a good some follower, i will mark it as helpul thread & monitor it.
i not test the code yet, hope it soon..
Mnkras replied on at Permalink Reply
Mnkras
Take a look at this,

http://pastie.org/1562489

works really well for ppl not logged in, (outputheaderitems in view.php)
Mnkras replied on at Permalink Reply
Mnkras
Phallanx,

Here is kinda, what i was working on,
http://pastie.org/1562892
I took out the combining part, but it it works, i havn't added version checking yet, but thats easy,

ignore the crappy code :P
Phallanx replied on at Permalink Reply
Phallanx
@frz
Ahh. That's better. I was lost in the threads about 40 posts ago...lol. Although because I was replying to a specific place in the thread; now some of my posts don't make sense chronologically as I didn't reference the OP :) .

My method will certainly break modules without the ignore or ability to force things to the top IF a module developer takes short-cuts. But hopefully I can at least pave the way for pitfalls if you are thinking about making changes to core based on my work. It basically boils down to if its asynchronous (AJAX) it will work.

@jleinbaugh
1.0.2 was tested on the shipped goggle maps and the premium one in the market place with no issues that I could see. Is the one you are using in the market place?

riotaj and I are discussing style sheets at the moment. He (apparently) uses some "hacks" which causes some issues under certain circumstances - he heavily uses IE switches. Once he reveals all his "tricks" I'll figure the best way of dealing with them. It's looking as if Steve was right about the way CSS gurus override with the assumption that a previously (also switched) css was loaded. I didn't quite appreciate what he was saying at the time.

@Mnkras
Try adding a new line ("\n") when concatenating the mimised scripts.I had exactly the same problems in the beginning with the core files which was a combination of order dependency and stripping out the "<script" tag. The latter means that any CDATA references no longer have a new line between the end of a script and the they are very particular about them (you must preserve ALL the newlines in the CDATA declaration).

Also. Be careful about comments such as "// Comment" There are a couple in the core files. If you don't strip it out, when you minify it sometimes the newline character eis removed effectively commenting out that section of code.
Mnkras replied on at Permalink Reply
Mnkras
Yea the PHP_EOL is basically \n

Even without minifying and just sticking them in 1 file causes errors.

On Feb 14, 2011 12:03 PM, "Concrete5 Community" <discussions@concretecms.com>
wrote:
Shotster replied on at Permalink Reply
Shotster
> Try adding a new line ("\n") when concatenating the mimised scripts.

Better yet, a semicolon.

> The latter means that any CDATA references no longer have a new
> line between the end of a script and the they are very particular about them
> (you must preserve ALL the newlines in the CDATA declaration).

CDATA sections are relevant only if you give a rip about W3C validation AND if the JS is inline within the document. (They aren't relevant in externally referenced JS files.) TONS of places in the C5 core SHOULD have CDATA sections, but the system works fine without them. You could just as easily eliminate the CDATA sections as you're minifying. (After all, as far as JS is concerned, they are just comment lines!)

And if you are consolidating everything to an externally referenced JS file (as opposed to putting it inline at the end of the document), then (as already stated) the CDATA sections aren't even needed! Strip 'em out!

If you are instead putting the consolidated JS at the end of the document, you could put the entire minified mess in its own CDATA section after the consolidation step. Just add the requisite CDATA markers at the top and bottom...

<script type="text/javascript">
//<![CDATA[
[...mess of minified code here...]
//]]>
</script>


That would keep the W3C validator happy. But again, if you're moving consolidated code to a separate JS file, then just strip the comment lines containing CDATA section markers.

-Steve
jleinbaugh replied on at Permalink Reply
jleinbaugh
It was the extended google map module by corretje. I rolled back to the original 1.0 version until I have time to play around.
Phallanx replied on at Permalink Reply
Phallanx
@jleinbaugh

OK. I'll see if I can hunt it down. Searching the Market Place din't revel anything
Phallanx replied on at Permalink Reply
Phallanx
@jleinbaugh
OK. It's a paid on-on, so I cannot download and test.

It seems to use GoogleMapAPI 2.5 which is an ancient V2 interface (never played with V2).

At first glance it looks like it should work (as all the others do). The quick fix is to ignore it of course - but there's a shed-load of JS in there so we don't really want to do that.

What exactly is the problem you are having with it (blank display?, no markers? no info windows?)
jleinbaugh replied on at Permalink Reply
jleinbaugh
Yes. Blank display.
Phallanx replied on at Permalink Reply
Phallanx
@jleinbaugh

For now. Add 'extended_google_map' to the ignore_ keys.

$this->ignore_keys = array( 'google_ad','PMW.EEA', 'show_ads.js', 'gmodules.com','extended_google_map');
jleinbaugh replied on at Permalink Reply
jleinbaugh
just pasting the above code didn't work. miser 1.0 works, but 1.0.1 and 1.0.2 produce a blank screen. by blank screen I mean the block is blank, the rest of the page renders fine.
Phallanx replied on at Permalink Reply
Phallanx
@jleinbaugh - map module not working

Give the 1.1 version a try. It's been tested with more modules. Normally I would install and try it myself. It's odd that the other two goggles maps ones work fine but that one doesn't (and by inspection I cannot really see a reason why it shouldn't). And ignoring it should mean it stays exactly where it is normally. I cannot see any obvious dependencies (outside of goggles)

Is that the only module?
jleinbaugh replied on at Permalink Reply
jleinbaugh
just got back from vacation and uploaded the two new files. didn't see any difference with the extended map module, but added maps.google.com to the top_Head_keys and it's working now. Not sure if that's the right way to do it, but it loads the block now anyway. Will play more this weekend and post results with and without miser...
Phallanx replied on at Permalink Reply
Phallanx
Well If it works, then it is more right than if it doesn't ;)
Ideally you don't want it in the head, and ordinarily I would find the best place for it for you. But as long as it works-that's ok (and you said you weren't a programmer :P ). Kudos for keeping with it.

You will probably notice (or you may not) a couple of issues with this version.

1. The google analytics code doesn't show up in the admin area (Site-wide settings). It's in your code,but the admin thing cannot see it because it gets moved.

2. Rather a lot of files in your css and js directories.

Both have been addressed in the next version. I'm just waiting for the go-ahead from riotaj that everything is ok,and then I'll upload.
jleinbaugh replied on at Permalink Reply
jleinbaugh
I should add, if it makes any difference, that if I put 'maps.google.com' as part of ignore_keys instead of top_Head_keys it renders the block as well - not sure which is the better place to put it...
Phallanx replied on at Permalink Reply
Phallanx
Sweet.

The order of preference is this.

1. Not in any lists - lets the script do it's thing.
2. top_Foot_keys - At the end of the document, but before links
3. ignore_keys - leaves it where it is (if it is in the header already, then it is the same as 4).
4. top_Head_keys - puts it into the header

I'm just sorry you need to know this. I really should make a nice front end so it can be acessed from the Admin UI.
aborn replied on at Permalink Reply
Hi.

I get the trouble with blank Google maps with the standard package (included in the C5 distribution). The strange part is that it shows up when I'm logged in to the site, but not otherwise. I've tried to add 'maps.google.com' to the different Category Lists in the miser file, but nothing seems to help.

The map is supposed to go on the bottom of the pagehttp://www.brf-uttern.se/boendeservice/sophantering/...

Other than that, my hats off for Phallanx for making an effort to fix the "long initial load" issue which in my book is one of the biggest issues with C5.
Phallanx replied on at Permalink Reply
Phallanx
@aborn

Make sure the CC5 cache is OFF (and cleared).
Go into the/ files/cache/ directory and delete both the directories css and js.

Then is should work.
aborn replied on at Permalink Reply
Nope, it still only works when logged in to the site. Is there something more then 'maps.google.com' that needs to be put in the Category lists?

//aborn
Phallanx replied on at Permalink Reply
Phallanx
I couldn't help but notice (I'm not sure if it is intentional or not).

But on your contacts page, you have gone to the effort to mask the email addresses in the page source at the top of the contacts page. However. Those email addresses are in plain text for the drop-down menu (when you view the page source).
jleinbaugh replied on at Permalink Reply
jleinbaugh
nope, not my intention at all - thanks and I'll have to hack that up too! One thing I liked about my old cms is that it automatically parsed the entire page and made hyperlinks out of web addresses and did a little javascript on all email addresses... trying to make all the changes in C5 to do that... looks like this non-programmer is back to php!
12345j replied on at Permalink Reply 2 Attachments
12345j
heres my results
Phallanx replied on at Permalink Reply
Phallanx
@12345

Your results are interesting.

1. There is little difference between cached and un-cached.
2. The number of connections between cached and uncached is about the same (11 & 15).My site goes from 40 (un-cached) to 3 (cached)
3. Your content, however goes from 147K down to 7K.

I'm guessing, but I would imagine that your site mainly consists of external content i.e not actually on your server - iframes, youtube et al.) And this is where most of your delays are. As such, you won't get much of a benefit from either the htaccess mod or by juggling the scripts around since although your page is loaded in about 1sec, there's probably not a lot to look at until the external content arrives.

You probably notice more when in edit mode since there will be far more javascript compared to external content. But that cannot be tested from the web page test.

Just guessing from the numbers. Do you have a link?
12345j replied on at Permalink Reply
12345j
yeah, I was a little confused by them too. My site is 12345j.co.cc my guess is that since its a free webhost that screwed it up somehow- though the before results are faster than usual, it usually takes more like 4 seconds. It doesn't have much external content, or internal content, so maybe the load difference isn't as big. Ill try again with hostgator later today. The second result for the after is much the same as the before, but the after first ones first byte is significantly lower- which is probably caused by this script.
in my head is this
<!-- Sorted by Miser 1.0.2 in 0.002 Secs -->
Phallanx replied on at Permalink Reply
Phallanx
@12345j

Just looked at your site. There isn't really much for Miser to optimise. There is no in-line javascript or CSS to speak of. It's rattling through in about 3ms. All of your delays are from requests.

1.1 should help you there by combining more of the requests and allowing the browser to cache better. give that a whirl. (Don't forget to turn off the CC5 cache).
adamjohnson replied on at Permalink Reply
adamjohnson
Some specific scripts to add to the "Do not move" list would be the HTML5 Shim/Shiv & (guessing here) Modernizr as well.

IE appears to need to have the Shim/Modernizr in the head in order to render the page properly.

http://modernizr.com

http://code.google.com/p/html5shim/...

Can anyone else confirm this?

More to follow...

Edit: 1.0.2 (?) of miser caused html5 shim to move to the bottom of the doc; however, the IE conditional comment that it was in did not move with it as it should have. Something else to consider... :-)
Mnkras replied on at Permalink Reply
Mnkras
This Code will minify all js and use google's cdn for jquery, jquery ui, and swfobject.
http://pastie.org/1564633

No Bugs in the js yet :) working on making it cleaner, and css

oh, you have to stick this in your site.php also,
define('ENABLE_ASSET_COMPRESSION', true);


also make a file in /helpers called html.php and stick this in it
http://pastie.org/1564687
Phallanx replied on at Permalink Reply
Phallanx
@Mnkras

Is CssMin part of the core?

CssMin::minify($css);
Fernandos replied on at Permalink Reply
Fernandos
Mike I fixed the CSSMin class, so that the path to the core images works. To achieve that I've added two options to the class and some regex kungfu..
cya tomorrow
Phallanx replied on at Permalink Reply
Phallanx
@Mnkras

Take a look at the "Reinhold Weber method"

http://www.catswhocode.com/blog/3-ways-to-compress-css-files-using-...
Phallanx replied on at Permalink Reply
Phallanx
@riotaj
Sounds like 1.0.0 which wasn't aware of conditional statements and therefore picked them out and moved them.

If you look at your web page source (just above the </head> tag). You should see so, something like <! --- Sorted By Miser 1.x.x in x.xxx seconds -->. So you can tell which version it is
adamjohnson replied on at Permalink Reply
adamjohnson
@Phallanx:

Definitely 1.0.2. There were both the HTML5 Shim & IE7.js (http://code.google.com/p/ie7-js/... , both scripts ) in a "lt IE 9" conditional comment. Now they are in the footer sans conditional comment. I'll see if I can add them to the exclude list until the next round.
RodneyC5 replied on at Permalink Reply
For my sins I am forced to use a Windows IIS server. When trying this latest code I get this:

Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of array_pop(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in C:\Domains\restioarchitecture.co.za\wwwroot\helpers\miser.php on line 250

Maybe you know a quick solution, I will Google anyway to see if I can get around it.
Thanks for an excellent (much needed) script.
RodneyC5 replied on at Permalink Reply
I think I found the answer: In line 250 and line 260
of miser.php, remove the ampersand symbols in

<code>@array_pop ( &$s_path );
@array_pop ( &$s_path );</code>
Now working as:
<code>@array_pop ( $s_path );
@array_pop ( $s_path );</code>
Phallanx replied on at Permalink Reply
Phallanx
@RodneyC5 - warnings under windows

Ok. I'll make a note of it. It hasn't made it in 1.1 but I'll look at it for the next one.

That function is at around 520 now if you need to change it. Thanks for spending the time to investigate. I don't have a windows server so any issues you come across I'm very interested in.
Phallanx replied on at Permalink Reply
Phallanx
Woah. I hadn't checked in for a while since I hadn't had any e-mail prompts that anyone had posted. Obviously something not right there. Looks like I have some catching up to do.

Anyway. I'll get to answering the questions in a while. Apologies.
------------>
It's the weekend and I've been at it again :)

We're now on version 1.1 (attached) and there have been some changes. It's been up issued a minor version because now it supports combining CSS and javascript files which is a major functional change. There are a couple of caveats which I'll out-line now so people don't get bored of my ranmblings and skip them half-way through.

1. To take advantage of the combining (which is default), you need to clear and DISABLE the CC5 cache. Don't worry. It's because it slows it down and (sometimes)seems to by-pass the rendering so you won't see any improvements. (Perhaps a CC5 guru can explain how the cache works to me at some point.). So you won't lose anything by turning it off. You will potentially improve your site responsiveness and you can always turn it back on again later.

2. If you use inline conditional switches ( <!--[IF IE]-->) in the head. You may have to put some of your required CSS and/or javascript between them too if you want to override the sorting process. The mod leaves conditional switches alone properly now, but moves everything else around them so effectively they seem to move and asking the mod to ignore them won't work (they are ignored anyway). Any in the body will stay in the body. It's only those in the head. 90% of the time it isn't an issue, it depends on what assumptions have been made when deciding to use the switches..

But apart from that. We (myself and riotaj - who's been an absolute star) have checked against all of the core modules and themes (and all the free ones we could find) and things "seem" to be good. The combining seems to have reduced the total load time a bit and (from reports) halved the time to render from the original mod (depending on the site content). In addition to the combining and bug fixing, I've also added some more CDNS.

But of course it's only been tested on a small sample of the multitude of site set-ups so all feedback (good or bad) is appreciated if you choose to try.

Be gentle :) And if it works for you, don't forget to post the benchmarks.
jleinbaugh replied on at Permalink Reply
jleinbaugh
been playing around with the new version... for some reason the tiny_mce editor is not working... if I disable miser and view it works, but not if enabled (displays the header bar with add image etc, then just a small box with html code) Specifically I'm talking about the Content block, but I see it anywhere the wysiwyg editor is called. Am I missing something?
Phallanx replied on at Permalink Reply
Phallanx
OK.

change

$this->top_Foot_keys = array( 'var CCM_');

to

$this->top_Foot_keys = array( 'var CCM_','tiny_mce.js' );
jleinbaugh replied on at Permalink Reply
jleinbaugh
should have said "if enabled" it only displays... but the code change made the difference - works as expected now! Thanks for your tireless efforts!
ea1958 replied on at Permalink Reply
ea1958
Errr, is this the kind of stuff that gets incorporated into future CC5 builds?
ea1958-Noob who must be obeyed (callback to H. Rider Haggard:-)
Phallanx replied on at Permalink Reply
Phallanx
Probably not. But some of the ideas might trickle in.
Phallanx replied on at Permalink Reply
Phallanx
1.2.0 Is now available. It addresses the following:

1. Fixes the goggles adsense code not displayed in the Admin screen.
2 Fixes the tiny MCE editor not displaying correctly.

It now requires less files in the css and js directories (if you are using 1.1.0; delete the currently generated files in those directories so that a smaller number can be created. The mod creates files automagically, but does not delete them).

Also added some more CDNS.

Enjoy.
adamjohnson replied on at Permalink Reply
adamjohnson
@coreteam

So, wrapping up this thread it's pretty clear that many C5 users desire this kind of functionality within Concrete5. I know that this has been thought about in 5.4.1. What are the plans (if any) to move JS to the bottom by default? Would it be done automatically or would add on dev's have to update their packages to reflect this change?

From our tests, (almost) all of the core blocks seem to function fine when placed before the closing <body> tag (with the exception of tiny_mce.js). Also, when JS is moved to the bottom, start render times are cut in half (meaning that the user is able to actually see the page & "think" that the page is loading faster); thereby, improving the end user experience. Additionally, in my tests, overall page load and first byte seems to always be faster with optimized CSS & JS placement/minification.

@coreteam thanks in advance for your time. I'd also like to thank Phallanx for his enduring efforts in creating this wonderful mod.
Phallanx replied on at Permalink Reply
Phallanx
@riotaj
Perhaps you could post some benchmarks?

NB:
Tiny MCE is moved to the bottom. It just didn't like being merged.
adamjohnson replied on at Permalink Reply 1 Attachment
adamjohnson
Benchmarks are attached for reference from several of my C5 sites. Start render seems to drastically improve with the mod on first load in addition to first byte and complete page load.

FWIW, these results were probably done with v1.1.x. As of this writing, 1.2.0 is the latest version. From my tests, 1.2.0 is just as fast (if not faster) than the previous versions.
Phallanx replied on at Permalink Reply
Phallanx
@riotaj
Sweet.
Many thanks for all your hard work (again :)) Things are looking good

There is no real functional difference between 1.1 and 1.2. Just addresses the issues I outlined previously. So in terms of performance; they should be identical.
jleinbaugh replied on at Permalink Reply
jleinbaugh
I had to move tiny_mce back to the top on my site as it wouldn't load the wysiwyg editor on the Pro-News block (ProNews is loaded on the dashboard backend as opposed to editing in context out front) Is there a problem doing that?
wavemedia replied on at Permalink Reply
wavemedia
Hello, Ive searched like many for ways to make Concrete 5 faster. I downloaded the files and installed them on my setup. The 2nd part of modifying the .htaccess file on my server causes it to crash. I host my website on godaddy.com shared servers.

Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator and inform them of the time the error occurred, and anything you might have done that may have caused the error.More information about this error may be available in the server error log.

Apache Server at mysite.org Port 80

Not sure what to make of it.
Phallanx replied on at Permalink Reply
Phallanx
@wavemedia
It means that your host has not made the modules (in apache) available for your account. You cannot use it, so do not add it to you htaccess (you could ask them to enable mod_expires and mod_gzip, then you could benefit from it).

The CC5 script, however, will work fine.

I've been meaning to post the snippet which will check first (see below). But all it will do (on your server) is ignore the code so that you don't get error 500-it will not enable the features unless apache has the modules installed.

<IfModule mod_gzip.c>
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
<IfModule mod_expires.c>
Header unset Pragma
FileETag None
andrew replied on at Permalink Reply
andrew
I haven't checked in on this thread in a little way, so let me just say..WOW. I am very impressed with the direction this has taken. I really like the approach of keeping it in one helper specifically dedicated to HTML post-processing and optimization. I've checked this into the core svn repository at helpers/html/optimizer.php and merged the change into view.php. A few things (and a bug I found):

1. I've changed some of the names to better fall in with our approach in some places.
2. I've made this post-processing support full page caching.
3. I've made this an optional thing, defaulted off, with the define() 'ENABLE_HTML_OPTIMIZATION'. This is a global define(), and you can turn it to true to enable it in config/site.php. Eventually this will probably makes its way into a GUI, and/or be defaulted on.
4. I've moved this from css/ and js/, which are typically read only, and moved them into files/cache/. I'd love it if this could be within files/cache/css/ and files/cache/js but right now it just lives in the root.

I discovered on bug when trying to apply this to concrete5.org locally. In our concrete5.org site, our main.css file includes other CSS files like this:

@import url("html5/reset.css");
@import url("grid.css");
@import url("fonts.css");
@import url("core.css");

Currently this does not work. It puts a directory before the path, but keeps the quotes around the original paths, resulting in this:

@import url(/themes/version_3/css/"html5/reset.css");@import url(/themes/version_3/css/"grid.css");@import url(/themes/version_3/css/"fonts.css");@import url(/themes/version_3/css/"core.css");

This breaks. If I remove the quotes from the main.css it works great. Just something to poke at.

I'm blown away. Nice work. Thanks to everyone for sticking with this.
Phallanx replied on at Permalink Reply
Phallanx
@Andrew
Good catch.
I'm sitting on it for a week or two to see what other things crop up (I'll then release an update that will address it).I'm sure you know where to put the string_replace in the meantime ;)

1.
I've seen the changes you've made. I expect there ill be quite a few more since it doesn't really fit with your architecture. The current interface is desirable from my point of view as it is designed to be CMS indifferent and self contained (I expect you've seen some switches in there already). However, you are probably at the stage now that (if you are convinced by the mod) you would require it to be more integrated and in-line with your architecture.

2.
I have no idea what this means. I don't know how the cache in CC5 works (I did ask for a quick explanation earlier). But turning off the CC5 cache produces better results.

3.
Yup. I see what you've done there. You can also add some more if you like and set things like minification etc. I suppose it all depends on how much you want to expose all the options when if/when you create an Admin interface. The minimum I think would be ENABLE_HTML_OPTIMIZATION and IGNORE_LIST (the latter for compatibility with obnoxious blocks).

4.
I used those directories because they were convenient (none of the systems we tested on were read only) and, hard-coded them with a view to being able to set them through the properties . Additionally, in the next release, the directories will be created if they do not exist, so you can put them wherever you want without it falling over (excepting permissions of course) . I have seen the constants that replace them. But my preference would be that the VIEW.php sets them from the config file (similar to as you have done with ENABLE_HTML_OPTIMIZATION). That of course requires more responsibility in the view and we are starting to move away from the 1 file transparently doing everything for a more formal interface that can be controlled from CC5. But that's your call. Depends what you have in mind.

Finally.

Don't forget to post some benchmarks :)
Mnkras replied on at Permalink Reply
Mnkras
@andrew
you should change

$dir = DIR_FILES_CACHE;
$reldir = REL_DIR_FILES_CACHE;

to
$dir = DIR_FILES_CACHE.'/';
$reldir = REL_DIR_FILES_CACHE.'/';
TheRealSean replied on at Permalink Reply
TheRealSean
I have no idea how I have missed this thread? must be the new site changes, but wow this is a great thread.

I have been looking to improve the page loading of a page that has up to 300 images on and after reading this the js is provably causing this.

Im glad I found this thread at home I could not take that much time to read at work and even had to paraphrase a few times. (Just over and hour to get through)

Im hoping to be able to play with this later today. Thanks again
adamjohnson replied on at Permalink Reply
adamjohnson
This is great news to hear. Looking forward to it in the next release.


@Andrew: you should check out this article about @import:

http://www.stevesouders.com/blog/2009/04/09/dont-use-import/...

It details how @import loads stylesheets consecutively rather than in parallel.
jleinbaugh replied on at Permalink Reply
jleinbaugh
So what does this mean when the next release of C5 comes out? Will I need to delete the view and miser files with the next update (which I have no idea when that could happen)
Mnkras replied on at Permalink Reply
Mnkras
yes, with the next version you will have to remove the files, updates are not automatic, so you don't have to worry about anything :)
jleinbaugh replied on at Permalink Reply
jleinbaugh
just out of curiosity, can an average joe like me access the svn repository, or is it a developer only thing?
Mnkras replied on at Permalink Reply
Mnkras
If you request access to the beta crew, you have view access to the svn.
When I get home I can upload a zip with the changed files, you don't want to
use the svn version, its a bit buggy. But I can get those files for you.
On Mar 6, 2011 6:51 PM, "Concrete5 Community" <discussions@concretecms.com>
wrote:
Phallanx replied on at Permalink Reply
Phallanx
@jleinbaugh

The pro news block is another paid add on, so I cannot troubleshoot for you. But if it works putting it in the top, then there is no problem - it just slows down your site. Get too many in the top, and you might as well not use the mod.

Anyone can access the svn. Just remember "Beta" = "Still doesn't work!" But I'm not part of the core-team, not beta project, nor any other of the special nooks and crannies that seem to be prolific in CC5. I'm just a normal Joe Public user like yourself, so the CC5 svn will always be behind anything I post here and, additionally, will not be the same.
frz replied on at Permalink Reply
frz
Please don't use these changes in beta.

Turns out Phallanx has some weird non MIT license for the code he's written that excludes corporate use unless you do some one off deal with him personally. Obviously that doesn't jive with concrete5 at all so we can't include this as is. Someone needs to rewrite this stuff he's got in there until its unique enough from what he's done that it doesn't infringe on his intellectual property.

Wish I didn't have to be a debbie downer on this but Andrew noticed it when he put it into subversion. I want to be sure that any shops that are cherry picking out of beta for their clients realize they will be in breach of license if they use the current version of beta on a commercial site.

-sigh-.

I hope we can get past this quickly, from everything I've read this seems like an awesome improvement to have.
Phallanx replied on at Permalink Reply
Phallanx
Oh dear Franz.
As I pointed out in my email making you and Andrew aware of the license, There's no problem with corporate use as long as they too share. Not a weird license at all. A standard, well known Creative Commons license to promote the sharing of free software.

Here's the license which is detailed at the top of the miser.php file
http://creativecommons.org/licenses/by-nc-sa/3.0/...

But apparently that's not free enough.
Shotster replied on at Permalink Reply
Shotster
> There's no problem with corporate use as long as they too share.

Yet the CC license you reference specifically states...

> Noncommercial — You may not use this work for commercial purposes.

Just trying to understand,

-Steve
Phallanx replied on at Permalink Reply
Phallanx
The full licence (Creative commons is layered to enable easy reading) is here
http://creativecommons.org/licenses/by-nc-sa/3.0/legalcode...

The section you are probably interested in is 4.c which states:

"You may not exercise any of the rights granted to You in Section 3 above in any manner that is primarily intended for or directed toward commercial advantage or private monetary compensation."

So corporations can use it. They just cannot charge for the product if they do - they have to share also (without asking for a waiver - they can of course ask for one).
TheRealSean replied on at Permalink Reply
TheRealSean
Im never to sure how this works,
so would I be able to use this within a website, if we charge for the website, the website is for someone who provides a service(premium) and not a product but the fact we are providing a website is in itself a product or deliverable so could be in breach of a CC license.

I don't mind sharing code I do with others but the company I work with has a claim to the code I write and not me.


Also I am noticing that the miser appears to have trouble running 3 levels deep. It works on all pages above 2 levels deep but any further then that and the merge script stops working.

I can move the pages to the second level and they work again any ideas or reasons for why this could be doing this?
Phallanx replied on at Permalink Reply
Phallanx
@seanom
Do you have a website address that demonstrates it? Stops working is a bit vague.

I really don't want this thread to degenerate into a licence thread. But.

The "spirit" that I have released it in is:

If you are a private owner (family site, private blog, informational etc) or you are a school, charity, NPO, open source or free-ware site. Then you can just go right ahead and use it without a care in the world. These are examples of "non-commercial" activities. I also don't have an issue with donation sites and/or sites that solely derive an income through google adverts etc. If you are worried that you fall through a hole, just ask and I will cross the i's and t's and provide a waiver if appropriate.

If your site is a commercial one (i.e its purpose is to make money). Then there is a high probability that a waiver is required. Things like e-commerce, web-site builders, internet services etc. Exceptions are things like concret5, which is a business that derives income, but distributes the product without charge under a similar licence - it shares with the community.

It's really not a difficult concept. If your an altruistic person-you can use it. If your a money grabber. Then you need permission.

I wouldn't worry too much though. I'm sure the CC5 team are working away in the background to put the results of this thread into CC5. So non-commercial activities can benefit now. Commercial activities will have to wait for the CC5 team to roll out their flavour.

How about some benchmarks?
(Should get that in a signature...lol)
frz replied on at Permalink Reply
frz
Yes let's please not get into GPL vs MIT. "free" just means different things
to different people and were happy to have Phallanx's energy even if we can't use his code


Moving on....


Best wishes
Pecked out on an iPhone
TheRealSean replied on at Permalink Reply
TheRealSean
I have tried to clear the cache but that has not seemed to solve the issue.

I am sure this is my fault, I have included or done something which is breaking the scripts ability to merge the scripts? but I can not work out what it is that I have done differently on these pages over the other pages?.

The page includes only a gallery block, and this is included on other pages found within the gallery section that work.

The Url is
http://www.361photography.com/c5/...
The following two links both work
http://www.361photography.com/c5/clients/... works here
http://www.361photography.com/c5/clients/realnet/... works here

Any page that is an album under the clients section as an album
http://www.361photography.com/c5/clients/realnet/album/...
does not work here
I thought it could be my page type that was affecting this but I have the showcase images working fine on the following page

http://www.361photography.com/c5/gallery/showcase/...
Phallanx replied on at Permalink Reply
Phallanx
@seanom
Apart from clearing the CC5 cache. Did you also turn it off?

I commented a while ago that the CC5 cache seems to bypass the script but only sometimes. I think this is what you are seeing.
It doesn't seem to be that the script is unable to merge. It seems that the script just isn't being used at all on some of your pages.
Phallanx replied on at Permalink Reply
Phallanx
@seanom

Hmmm.

Miser basically intercepts the page rendering (in view.php), re-writes a load of stuff and then passes it back to the renderer. If Miser isn't being loaded, then the renderer isn't being called. This sort of thing happens with the CC5 cache when it serves up a cached file to the browser instead of rendering the page.

Where is your album file function being called? Is it in a block?
adamjohnson replied on at Permalink Reply
adamjohnson
It looks like it's working for me 3+ levels deep. No issues I can see:

http://hp.ajdwv.com/index.php/about/miser-1-1-3/three-levels-deep...
Phallanx replied on at Permalink Reply
Phallanx
@seanom
Another thought. Have you turned off and cleared the CC5 cache?
TheRealSean replied on at Permalink Reply
TheRealSean
I have cleared the cache and ensured the cache is turned off,

there are still files within the cache folder so I have removed those too, but it still does not run the script?,

I have created a couple of new pages to see if this helps but nothing seems to work with that either?
TheRealSean replied on at Permalink Reply
TheRealSean
Ok I have it figured I was running an ob_start() on my foreach $image within my gallery and then using ob_flush() at the end the use of the output buffer seems to screw about with the scripts and doesn't load the merger script

if I remove the output buffer the script starts working.

Thank you for your help
Phallanx replied on at Permalink Reply
Phallanx
@seanom & okapi

Sweet.
Does the script make a difference to your site(s)?
frz replied on at Permalink Reply
frz
My apologies for saying weird, that post was at 5:30am. I'm afraid it still doesn't jive with MIT.

Best wishes
Pecked out on an iPhone
ea1958 replied on at Permalink Reply
ea1958
You guys might be too young to remember this:
http://mixergy.com/chris-pearson-matt-mullenweg/...
how I long for the days...
-kidding
Phallanx replied on at Permalink Reply
Phallanx
@ea1958
Jul 14, 2010
I'd be surprised if anyone that young can do anything apart from gurgle...lol.
pakigreenl replied on at Permalink Reply
pakigreenl
Can You post the most current version with updated install info. i am confused as it looks like the files and names change as you progress down the thread. Thanks
Phallanx replied on at Permalink Reply
Phallanx
@pakigreenl
Yup. good idea. It's unfortunate I cannot change the original post then I could have just kept that up to date to save confusion.

The current released version is 1.2.0 as of 14th March 2011(Attached to this post).
It consists of 2 files

1. View.php (goes into the top level "libraries" directory)
2. miser.php (goes in the top level "helpers" directory)

You should also turn off and clear the CC5 cache.

Your top level "js" and "css" directories must be writeable by the server since that is where Miser will store the merged files

Known Issues.
@import definitions in CSS files cannot be surrounded by quotes.

if you have mod_gzip and/or mod_expires enabled on your Apache server. Then you can use the following code in your .htaccess to improve browser caching.

<IfModule mod_deflate.c>
# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
</IfModule>
<IfModule mod_expires.c>
<IfModule mod_headers.c>
Header unset Pragma
okapi replied on at Permalink Reply
okapi
Unfortunately page loads even worse. 8 to 9 seconds is too much...
I also get an error:

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect ... etc

Michael
Phallanx replied on at Permalink Reply
Phallanx
The "...etc" bit is important for me to figure out why you are getting the warning.
okapi replied on at Permalink Reply
okapi
This is the complete warning:

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/***/webhttp://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js) is not within the allowed path(s): (/***/web:/***/tmp:/usr/share/pear) in /***/web/notebook/helpers/miser.php on line 464
Phallanx replied on at Permalink Reply
Phallanx
@okapi
OK.
If you are willing......

Find in miser.php this line (line 464)
return file_exists($path);

change it to
return @file_exists($path);


You might also need to turn off CDNS by replacing (line 29)

private $use_CDN = TRUE;

With
private $use_CDN = FALSE;
okapi replied on at Permalink Reply
okapi
Thank you, Phallanx!
return @file_exists($path);

that did the trick, no more error here!
jasteele12 replied on at Permalink Reply
jasteele12
Hello Phallanx,

I'm afraid your example here is just not correct. mod_gzip is for legacy Apache 1.3, mod_deflate is for Apache 2.

You are also mixing up mod_headers and mod_expires.

Take a look here for some great host testing, and correct usage:

http://www.ditii.com/2010/09/05/htaccess-most-essential-blog-optimi...

FYI - John
Phallanx replied on at Permalink Reply
Phallanx
@jasteele123
Well. I got most of it correct (it's only the module switches). I originally posted it without any ifmodule switches at all (was that more correct? - I suppose it was). I cobbled it together from several examples spread out over the internet. I've updated it to show the correct module switches. If you have a better one. Then by all means post it.

But. more importantly......
Have you installed miser? does it make a difference? How about posting some benchmarks? ;)
Phallanx replied on at Permalink Reply
Phallanx
Miser 1.3.1 has been released as of 28th March 2011 with the following changes:

1. Fixed the bug reported by Andrew for CSS urls with quotes.
2. Miser now scans for @imports and merges their contents.
3. Added HTML minification.
4. Optimised the code to reduce server load.
4. Miser now comes with all options enabled by default.
5. Changing settings is now acheived from the view.php file rather than editing miser.php (1 step closer to an addon installer).
6. Added a readme.txt.
7. Miser now saves files to the cache directory as suggested by Andrew. You can delete all the files in the CSS and JS top level directories (_merge.js etc)as they are no longer used.

The inclusion of the @imports is the major step forward. Themes that use them should see a noticeable improvement.
fastcrash replied on at Permalink Reply
fastcrash
thanks Phallanx,
although my site still not ready yet, i will download this for the future
Phallanx replied on at Permalink Reply
Phallanx
Make sure you have 1.3.1 rather than the 1.3.0 that I originally uploaded -I included the wrong file and have corrected it.
jleinbaugh replied on at Permalink Reply
jleinbaugh
I'm confused by the readme.txt as it says to upload the jsmin.php along with miser, but earlier says that on Concrete 5 jsmin is not needed...
Phallanx replied on at Permalink Reply
Phallanx
Yup. You are right. Copy and paste error-apologies. I'll update the readmme.

You don't need it, but it won't hurt if you do copy it there (it won't be used).

----->
Done.
okapi replied on at Permalink Reply
okapi
I have just downloaded version 1.3.1 -
unfortunately, again i get a lot of errors:

Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/***/webimages/fancybox.png) is not within the allowed path(s): (/***/tmp:/usr/share/pear) in /***/helpers/miser.php on line 663
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/***/webimages/fancy_title_over.png) is not within the allowed path(s): (/***/tmp:/usr/share/pear) in /***/helpers/miser.php on line 663
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/***/webimages/fancybox-x.png) is not within the allowed path(s): (/***/tmp:/usr/share/pear) in /***/helpers/miser.php on line 663
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/***/webimages/blank.gif) is not within the allowed path(s): (/***/tmp:/usr/share/pear) in /***/helpers/miser.php on line 663
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/***/webimages/fancybox-y.png) is not within the allowed path(s): (/***/tmp:/usr/share/pear) in /***/helpers/miser.php on line 663
Phallanx replied on at Permalink Reply
Phallanx
@okapi
Are you sure your browser didn't just grab a cached version?

It seemed to be the updated one when I download.

OK.If you are willing.....

Line 663:
change
if (!file_exists( $_SERVER['DOCUMENT_ROOT'].$url_cleaned))

to

if (!@file_exists( $_SERVER['DOCUMENT_ROOT'].$url_cleaned))
okapi replied on at Permalink Reply
okapi
Thank you, now it works nicely!
I cleaned the browser cache, and downloaded the files again, but the "@" had to be added.
The html source is looking cool now... ;)
Phallanx replied on at Permalink Reply
Phallanx
@okapi r
Apologies. That report slipped through the net. A forum isn't the best tool for bug-tracking.

Where is your website? Do you have before and after benchmarks? Does it make any difference?
okapi replied on at Permalink Reply
okapi
i have no benchmarks yet, but it 'feels' already somehow better. Most of all, i love how the html source is looking now, and that even the superfish menu validates, because it's styles went off the html body!

actually i can't really tell if performance has definitely encreased or not. sometimes pages load slowly, sometimes they seem to load a bit faster.

just a question: is it possible, or at least thinkable that this compression functionality interferes with the built-in c5 caching system?
Phallanx replied on at Permalink Reply
Phallanx
@okapi
The CC5 caching should be turned OFF (and cleared for good measure). I will add that to the readme on the next update.
jleinbaugh replied on at Permalink Reply
jleinbaugh
I overwrote the two existing files and the site continues to run - haven't done any real testing to check speed differences, but at least it didn't break the site...
Phallanx replied on at Permalink Reply
Phallanx
@jleinbaugh
Sweet. Thats always a good sign.
jleinbaugh replied on at Permalink Reply
jleinbaugh
Okay, ran into one issue so far... maybe you have some insight. I discovered a problem where spaces were being removed from blocks between bolded and normal text. So it was removing spaces after <strong> tags.

When I went into miser.php and changed "private $endis_html_min" to "0" it works, but setting it to "1" causes it to strip the space, it appears to happen anytime I put in a special attribute (bold, italic, etc)... does that make any sense?
Phallanx replied on at Permalink Reply
Phallanx
What does a bold space look like?...lol
But seriously; minification is (mainly) the removal of unnecessary white-space Miser uses a simple method so as not to be overly taxing since it happens on every run. If it's not giving the required result then leave it off.
shenn replied on at Permalink Reply
I have a small issue with version 1.3.1 on windows machine.
I already deleted and disabled cache.
But on every page i get this error...
Warning: file_get_contents(D:\WWW\qweq/concrete/css/) [function.file-get-contents]: failed to open stream: No such file or directory in D:\WWW\Services\concrete5\concrete5.4.1.1\concrete\helpers\miser.php on line 535
Call Stack
#   Time   Memory   Function   Location
1   0.0002   657640   {main}( )   ..\index.php:0
2   0.1232   663568   require( 'd:\www\services\concrete5\concrete5.4.1.1\concrete\dispatcher.php' )   ..\index.php:10
3   0.4220   4866464   View->render( )   ..\dispatcher.php:246
4   1.7834   6958816   MiserHelper->optimise( )   ..\view.php:795
5   1.7834   6958816   MiserHelper->do_optimise( )   ..\miser.php:88
6   1.8607   7005760   MiserHelper->write_js( )   ..\miser.php:382
7   1.8607   7005992   MiserHelper->get_files( )   ..\miser.php:498
8   1.8757   7287392   file_get_contents ( )   ..\miser.php:535


Perhaps this has to do with the symbolic link I created for my concrete directory. I also get this error when i push the clear cache button in the backend.
Phallanx replied on at Permalink Reply
Phallanx
@Eelco2k
Hmmm.
I think you are probably right. Symlinks are notorius. I don't think there is a simple solution apart from don't use symlinks. Do you get the same problem with 1.2.0? (i'm guessing you do)

I'll have to think about it. I do have a windows box. But it is running Xampp and I've never had to delve into the underlying operation (it just works out of the box).
shenn replied on at Permalink Reply
I dugg a little bit deeper into the error i got but it's has to do something with a package "tony_stats" when i debug $this->clean($url[1]); in the get_files() function I get this.

string '/concrete/css/ccm.base.css?v=742d3ab71fa4b53e45665ffb590eb02b' (length=61)

--> <-- ===>

string '/themes/qweq_theme/css/screen.css' (length=33)

--> <-- ===>

string '/themes/qweq_theme/typography.css' (length=33)

--> <-- ===>

string '/concrete/js/ccm.base.js?v=742d3ab71fa4b53e45665ffb590eb02b' (length=59)

--> <-- ===>

string '/themes/qweq_theme/js/cufon-yui.js' (length=34)

--> <-- ===>

string '/themes/qweq_theme/js/Gotham_500-Gotham_700.font.js' (length=51)

--> <-- ===>

string '/index.php/tools/packages/tony_stats/services/?mode=tracker_js' (length=62)

-->

And in that function there is a if statement: if index.php is in the string. but it only returns ?mode=tracker_js as file. Which is not a file.

Hope you can create a fix for this. Thnx
Phallanx replied on at Permalink Reply
Phallanx
@Eelco2k
Hmm.
It looks like the cores file location is returning a funny path. It should just fail and ignore it, leaving the original link in-tact. There's 2 points where this could possibly be causing an issue. I've since beefed up the file location checks considerably for the next version but you can try these two until then.

on line 593 in the url_exists function replace
return @file_exists($path);

with
return (@file_exists($path) && @is_file($path));


Try that first and if you still have problems then

On line 534 in the get_files function replace
if (@file_exists($path)){

with
if (@file_exists($path) && @is_file($path)){


Have you also made the change to the index.php that I suggested for windows IIS servers previously? (Assuming it is Windows IIS andnot apache on windows)
shenn replied on at Permalink Reply
When adding this to the file no css and js file will be merged anymore. But only the last file in my debug failes... --> 'index.php/tools/packages/tony_stats/services/?mode=tracker_js'

in the loop all other file merge correctly --> the ccm.base.js,screen.css, typography.css, ccs.base.js, cufon-yui.js and Gotham_500-Gotham_700.font.js.

My IIS with PHP 5.3.3 x64 sees the DOCUMENT_ROOT server variable without the modification.
Phallanx replied on at Permalink Reply
Phallanx
@Eelco2k
do you have a link to your site so that I can see?
shenn replied on at Permalink Reply
http://qweq.syzygymedia.nl/

on top of the page it gives the result of: $this->debug($path,"path");

As you can see the last one has no file in the directory string...

So i changed in the same function:

if(@file_exists($path)) {

with:

if(@file_exists($path) && !is_dir($path)) {


in the get_files function.

But i don't know if the index.php/tools/packages/tony_stats/services/?mode=tracker_js is minified now... I'll have to check this.
shenn replied on at Permalink Reply
no the tony_stats <script> include in the footer is now stripped. I only get <!--STATS JS START--><!--STATS JS END-->
so perhaps a better regex pattern for getting this file index.php/tools/packages/tony_stats/services/?mode=tracker_js because it implodes at the ?. which causes the error...
Phallanx replied on at Permalink Reply
Phallanx
@Eelco2k
No. It needs to be ignored since it's looking like it isn't a javascript file, but a php file with an argument that (presumably) loads some javascript. It is also (presumably) place dependent (like google ads)since it uses start and end comments.

You can try uncommenting line 798 in view.php and replace
$o->keys_ignore('PMW.EEA');

with
$o->keys_ignore('tony_stats');


that will add it to the ignores list

Alternatively remove/disable Miser and let me see the site as it would normally be so that I can try and guess what it does.
shenn replied on at Permalink Reply
If fixed the error by putting the tony_tracker in the ignore array. But it would be nice if the file would also be minified instead of ignored.
Phallanx replied on at Permalink Reply
Phallanx
@Eelco2k
Sweet.
So can you just recap how you got from problems with simlinks to a working solution? Or was I just being thick and all it needed was adding to the ignores list?( I'll add that one to the default list. Thanks for spending the time to debug it.)

Your site is also returning an error 404 (not found) for crossdomain.xml. That will hurt performance.

Integrating javascript embedded in separate php files is on the road-map. But it's not very common (any more) unless php code needs to dynamically generate javascript output. In that case, it's not a good idea to put it in a cached file since its always changing. There are, however 2 files in the CC5 core that are static javascript in php files. And it's my intention to at least get these to remove the requests. But they only affect edit mode.

Minifying doesn't really do much for you in the grand scheme of things. It's a nicety for people viewing your site through a modem (rare nowadays). But if your going to throw a 4MB video at them-it's not really a significant consideration. It also stops Yslow complaining. But the biggest site killer is http requests. A site with 2 requests of 100K each will load a lot faster than a site with 20 requests of 1k each (especially for older browsers). I bet if you turn off minification for everything now you have it working-you'll not be able to measure any significant performance change. It's not like compression either, where you can gain significant download size improvements. Well. thats my view at least. others may disagree. But I've been doing a lot of benchmarking recently ;)
shenn replied on at Permalink Reply
@Phallanx There was nothing wrong with the symlinks in Windows. I Use the linkd.exe to create symlinks. but the error came from the tony_stats package. Now i included the tony_stats in the ignore list. And all works! But perhaps there is a option to include the tony_stats in de js merge.. but then the code has to be altered. now you check for the .js / .css extension but since tony_stats is a php file it doesn't work.

For now ignore is my solution but when i have more time, i will see if i can include such files as well.
Phallanx replied on at Permalink Reply
Phallanx
@Eelco2k
So it was me then...lol. Sorry, I misunderstood. If I thought it was an addon reporting the error, then that would have been my first suggestion.

Getting the contents of php generated javascript is quite straight forward (PHP has the eval function), however, identifying a PHP file containing javascript and where it is actually located is a bit trickier (especially with pretty URLS). The CC5 core generally uses "_js" in it's filename, but that's not guaranteed. Even if you do grab it, there is still no guarantee that it won't misbehave when re-ordered if it has dependencies

The only reliable way is to use "cURL" and then run it through the eval. This, however, causes performance issues if the file doesn't exist (I have already investigated this method as it is more generic than using concretes in-built CSS and JS finding functions).

As I said previously, it's on the road-map, but not a high priority due to the small number of instances (of all the blocks on your site, how many actually use JS embedded in PHP?). I take the view that there will always be a few blocks and themes that are resistant to the optimisation process. But even if you don't get 100% optimisation, 50% is better than nothing, right?
xclydes replied on at Permalink Reply
xclydes
I must admit, I have not been able to keep up with this thread as closely as I would have liked. With that said, I think I have experienced a similar problem (capturing which are not on disk in my utility package) to the one you are now faced with. I did find a solution which I have been testing (whenever I found time). It involves a HTML Parser (released under the MIT License, documented in the class file) and a little jumping through hoops.
It works using cURL, but can also work if cURL is not available and 'allow_url_fopen' is enabled in the server's php config. Enough rambling, the code.
/**
   * Gets the contents of the file specified. The file path may be disk relative,
   * disk absolute, or site absolute (HTTP).
   * @param String $filePath The file to be loaded.
   * @return The contents of the file, as it was read. An empty string will be returned
   * if the file cannot be found, or an error occured.
   */
   final public static function getFileContents( $filePath ){
      //Set the default string to be returned.
      $contents = '';
      try{
         //Determine if the file is local file or a file on disk.
         if( strpos($filePath, '://') > -1 ){//See if the path has a protocol indicator
            if(function_exists('curl_init')){//See if curl is available
               //Create the CURL handle

I was working this to have it included in the utility package (whenever it gets finished), but if you find it helpful feel free to use it.

I hope it can help, but I also hope that it may be tested and improved.

@Phallanx
Add-ons like yours are what help to take great software (Concrete5) and make it extraordindary, keep up the good work.

*Edit*
The html parser can be found athttp://simplehtmldom.sourceforge.net/index.htm.... I'm not sure if it might be of use, but there is the link just the same.
I am looking into using it (in conjunction with the code posted) to capture the core items and adding them to the asset_optimizer as it supports not just full html pages, but fragments as well.
Phallanx replied on at Permalink Reply
Phallanx
@xclydes
Many thanks for the vote of confidence. And thanks for that link to the HTML parser. I'm going to have to find a use for that.

In the scripts current form. No files are loaded externally from other sites, and the script attempts to resolve local URLs to their real file paths (it just ignores things with http in it). So it can safely use the file functions (excepting the dreaded permissions of course). However. Even CC5 doesn't necessarily know where a file is (unless it is in the cache) and hunts for a file at various stages in the rendering process using things like view.php and the css.php in the tools directory. I was hoping not to have to copy and paste all the different searches (try here, else try here, else try here etc) and was looking to cURL to to do it for me. However. Although the DNS lookup and connection time is a limiting factor. The real killer is that if a file doesn't exist cURL only has a timeout resolution in seconds (unless libcurl is compiled in a certain manner and PHP >= 5.2.3).

Anyway. the result is that instead of processing a page in under 10ms, in Linux, regardless if a file exists or not. It can take several seconds using cURL if a file is missing. So rather than graceful degradation of optimisation (which won't kill your site), you get catastrophic degradation of performance.

I think what I need to do is find a better way of finding the absolute paths. Unfortunately, this means moving away from the monolithic file (which was nice and convenient) into a more modular file hierarchy to move CMS specific functions out of the main trunk.
xclydes replied on at Permalink Reply
xclydes
No problem, just glad I could help.

On the note of the curl overhead I don't fully agree, but my net admin skills have gotten a bit rusty, so I'll just agree until I get some time to do some research.

I'm gonna try to make some modifications to my package AND the documentation (I haven't forgotten..lol) tonight. So hopefully tomorrow there can be something new in the marketplace *fingers crossed*.
Phallanx replied on at Permalink Reply
Phallanx
@xclydes
Sweet.
I'll be sure to download them when they're available and take a look to see what tips I pick up.
Phallanx replied on at Permalink Reply
Phallanx
This sorting threads by most recent first is awesome - well done CC5 team. My mouse wheel got a hernia from this thread..so it should recover now.
andrew replied on at Permalink Reply
andrew
Thanks! Yeah, we pushed up a few niceties to the main website Monday morning.
RodneyC5 replied on at Permalink Reply
Thanks for the great work, this really makes a huge difference for me.
It works perfectly on Apache servers, I have it running on two sites.
I have one site on a windows server and there are are problems - see errors below.

I am thinking of telling the client that we need to move to another host but maybe you know of a simple reason why this occurs.
(C5 Cache is OFF and cleared)

It maybe that @ and/or 'quotes' not properly handled by PHP in Windows?

Thanks
Rodney


Warning: Call-time pass-by-reference has been deprecated in C:\Domains\restioarchitecture.co.za\wwwroot\helpers\miser.php on line 655

Warning: Call-time pass-by-reference has been deprecated in C:\Domains\restioarchitecture.co.za\wwwroot\helpers\miser.php on line 749

Warning: stripos() [function.stripos]: needle is not a string or an integer in C:\Domains\restioarchitecture.co.za\wwwroot\helpers\miser.php on line 97
Phallanx replied on at Permalink Reply
Phallanx
OK.

Line 655 replace
for ( $i = 0; $i < $num; $i++ )  @array_pop ( &$path );

with
for ( $i = 0; $i < $num; $i++ )  @array_pop ( $path );

And on line 749 replace
usort(&$items, array($this,"cmp"));

with
usort($items, array($this,"cmp"));


That shoulf take care of the first 2.

(I'm hoping the 3rd one goes away as it's not obvious without inserting debug statements).
Mnkras replied on at Permalink Reply
Mnkras
for your jquery tools cdn, it should not be
cdn.jquerytools.org/1.2.5/jquery.tools.min.js

but it should be
cdn.jquerytools.org/1.2.5/all/jquery.tools.min.js

without the /all/ it includes jquery again which will break a lot of stuff.

also, for the preg_match_alls you need to remove the first ?| from them on some systems, so '#(?|href|src)="(.+)"#' would be '#(href|src)="(.+)"#'
Phallanx replied on at Permalink Reply
Phallanx
>for your jquery tools cdn, it should not be
>cdn.jquerytools.org/1.2.5/jquery.tools.min.js
>but it should be
>cdn.jquerytools.org/1.2.5/all/jquery.tools.min.js
>without the /all/ it includes jquery again which will break a lot of stuff.

I wasn't aware it was an amalgamation. Thanks for pointing it out. I think even downloading the "all" pack probably isn't that safe. Maybe it would be better to include them all separately. The CDNS are only replaced if they appear on the page, so rather than downloading everything, only download the pack they specify.

>also, for the preg_match_alls you need to remove the first ?| from >them on some systems, so '#(?|href|src)="(.+)"#' would be '#(href|src)="(.+)"#'

That won't (didn't) work (in the places I've used it with the U switch). Don't ask me why. Regex is voodoo for masochists and never quite does what you want or think it will do. I'm a gnats whisker from parsing the whole page char-by-char in a circular buffer if it gives me any more grief.
RadiantWeb replied on at Permalink Reply
RadiantWeb
heads up on this.

I am seeing support requests come in for the tinyMCE not loading in the dashboard...all accounts of this issue have this hack in place.

Until this is fully supported by the core team, and implemented in a way that does not negatively effect the MANY dynamic javascript dependencies, you are at risk of receiving no support for your purchased addons.

The developers can not be expected to support hacked up Core's breaking addons.

So, there REALLY needs to be a warning placed on this topic to the effect of :"do this at your own risk"

I REALLY very much wish this thread was in a more appropriate place that would save people heart ache.

I'm seeing live sites breaking do to this. People browsing around who "barely" know what they are doing and think "oh hey...here we go! I like fast!"

It's fun and exciting, but it really should be a more concealed location until fully fleshed out.

ChadStrat
Phallanx replied on at Permalink Reply
Phallanx
@ChadStrat
Actually. It's not a "here we go! I like fast". It's more like "why is CC5 is so slow". As I stated in the "Questions" post. this was born out of a need-one that I now know to be common. I'm sure the team are working on it, but until they come up with something, there is this. It's a well known problem that is discussed countless times not only here but on many CMS boards. And it is usually the argument used by other CMSs against CC5. Not any more.

I'm not expecting developers to support a hacked core and as I discussed with Shotster, You can always tell them to turn it off (Miser advertises itself in the source so it's easy to detect). But after one of his clients demonstrated the problem and I could see the issue, I was able to direct them (the client) to a solution where we could all live in harmony. I'm not sure, but I think he did eventually change his code to lazy load (the most common reason for a module not working). But that's not a requirement to integrate with Miser. But it is an example of a very flexible developer who has the interests of his clients at heart.

Unfortunately, I cannot test with paid addons (as I expect yours are), so am reliant on people with those addons to post to this thread if they have any problems and show me the issue on their site so that I can make suggestions as to settings that will work (it's normally just adding a keyword to one of the lists-but you already know that).

Hiding a solution to a problem isn't really a way forward. Finding solutions to shared problems is. To give people an ultimatum, when you can just say turn it off is a little excessive, don't you think?
adamjohnson replied on at Permalink Reply
adamjohnson
Well said Phallanx.

@Chad: Are these your add ons that are having issues with the mod? If so, grant Phallanx a license and I am sure you two will be able to collaborate and solve what your customers are experiencing (working out any incompatibilities with your Blog add on would be especially key, if that is what you are referring to). I am happy to help where I can as well.

You are right. This thread is not likely the best place to have this sort of open discussion; however, Phallanx & I (as well as other people, I presume) have been testing his releases behind the scenes lately to try to find any bugs. But like he says, we can only test what we have access to.

BTW: I asked the Core Team about this thread/software in last Friday's "Totally Random" webisode, found on Ustream (the Q&A is towards the end):

http://www.ustream.tv/recorded/13704193...
RodneyC5 replied on at Permalink Reply
For the record, I have four different sites using Miser and have had no such problems with sites 'breaking' or issues with TinyMCE. There was a small issue with spaces in HTML which has been resolved.
More of a challenge was a Windows IIS site which did not set $DOCUMENT_ROOT - a well known frustration for PHP developers, also solved.

(That said, some js or css may not work as expected after being merged and minified - in those cases miser provides the option to exclude those bits of code while optimizing the rest)

What I have has is dramatic speed improvements on all sites, YSLOW score up to 97% and gives me confidence in the future use of C5 which I agree is a fantastic product except for the slowness experienced by me and others on less than optimal servers.

Every little bit helps and miser is now my preferred solution.
Phallanx replied on at Permalink Reply
Phallanx
WINDOWS IIS SERVERS ONLY

Many thanks to RodneyC5 for his time and effort in helping to investigate issues with using Miser on Windows IIS servers.

The problem (as it turns out) is a well known windows issue where the host doesn't set the httpd.conf entry for the "DOCUMENT_ROOT" variable. This is a windows issue rather than a miser issue but here is the solution.

In the index,php (in the roor directory) there is only 1 line of code. You need to replace:
require('concrete/dispatcher.php');


With

if( empty($_SERVER['DOCUMENT_ROOT']) ) { $_SERVER['DOCUMENT_ROOT'] = dirname(__FILE__); }
require('concrete/dispatcher.php');


This will set the variable if it isn't already set and everything should be fine.

I'm not happy with this (I'd prefer Miser to take care of it), but I have failed to find a reliable method for deriving the root path in windows IIS that works with CMSs in sub-directories and/or translated paths. This "may" also fix the simlink issue reported earlier, but I am not able to verify that configuration.
dancer replied on at Permalink Reply
dancer
Nothing to add technically.
Just a vote of support for your thoughts and dedication. Great Job.

...and this thread is a nightmare to follow... dates all over the shop.
Phallanx replied on at Permalink Reply
Phallanx
@dancer
Many thanks.

If you sort the thread by "Chronological (recent first)"; it's much easier to read. It's not an ideal platform for this type of thing and the original "question" isn't relevant any more. But there's little alternative apart from starting a new thread. It would be useful if the original question could be updated. At least then it would be relevant and people wouldn't have to search through (now) hundreds of posts to find the code.
zoinks replied on at Permalink Reply
Did not read whole thread, but...

I had some very slow pageloads on MyHosting with 5.3.3 ... I switched to PairNetworks (a little more expensive) and 5.4 and it's really fast now.

So, question for those of us late to this converstaion: is slow pages an issue anymore on 5.4? Doesn't seem to be for me. Same exact website, too.

Thanks!
jleinbaugh replied on at Permalink Reply
jleinbaugh
Is there anyway to deactivate miser when in the dashboard? some of the issues I'm having with tinymce are really only critical when in the dashboard, not on the live site...
Phallanx replied on at Permalink Reply
Phallanx
@jleinbaugh
Can you expand? I haven't seen TinyMCE in the dashboard anywhere. Is it a plug-in? Or am I missing something?
jleinbaugh replied on at Permalink Reply
jleinbaugh
there are a couple of addons (specifically those by Chad Strat - which is why he was upset about doing support for his addons with the "hack" installed) that call the wysiwyg editor in the dashboard. His Pro-news addon and MailMonkey addon both allow tinymce editing in the dashboard area instead of "live" I've included 'tiny_mce.js' in the head keys, and I can type, etc. but specifically it won't let me add an image or anything from the concrete "header" above the wysiwyg editor (add image, add file, insert link, customize toolbar) It goes through the motions of inserting an image - goes to file manager, select the image - but it's never place. Without miser it works fine. I realize it's paid addon - actually mail monkey isn't.

Anyway, loading speed on the backend isn't nearly as important to me, but I didn't know if it was a simple bit of coding to deactivate miser on the back end or not...
Phallanx replied on at Permalink Reply
Phallanx
@jleinbaugh
OK.
I downloaded the monkey addon and it exhibited the same/similer issues as you describe, but now have the editor working.

The solution is to move tiny mce into the head (which I think you said you did?????).

But this worked for me. Assuming you are using 1.3.1. On line 790 of view.php. Uncomment and replace
//$o->keys_top_head('eea.min.js');

with
$o->keys_top_Head( array('tiny_mce.js') );


The reason it's not working is because the script tags used by the addon are of the form
<script language="JavaScript">

Which was deprecated over 10 years ago (there is no language attribute any more and it will fail W3C validation). so Miser doesn't pick it out for optimisation (should it?.....Thinking about it!).
Anyway. That means tiny_mce gets moved but that script stuff doesn't and it relies on tiny_mce being loaded before it.

I would imagine that if they were of the form <script type="text/javascript"> or even "<script>". then it would probably work as expected.
RadiantWeb replied on at Permalink Reply
RadiantWeb
can you please point out where "<script language="JavaScript">" is within MailMonkey?

I can't seem to find that anywhere?

Chad
Phallanx replied on at Permalink Reply
Phallanx
I didn't look at the code. Just the HTML source. but this is what I see when I view the template editor page.
for="tag">Template Reference</label></td><td
align="left"> <a
href="http://www.mailchimp.com/resources/email-template-language/" target="_blank">Learn Mail Chimp Template Language</a></td></tr></table><div
style="text-align: left; height: 700px;" id="ccm-editor-pane"><script language="javascript">tinyMCE.init({
   mode : "textareas",
   width: "100%",
RadiantWeb replied on at Permalink Reply
RadiantWeb
right. that's not the addon. that's the core code javascript interjection for the WYSIWYG.

The addons are calling:

<div style="text-align: left; height: 700px;" id="ccm-editor-pane">
<?php   Loader::element('editor_init'); ?>
<?php   Loader::element('editor_config'); ?>
<?php   Loader::element('editor_controls', array('mode'=>'full')); ?>
<?php  echo $fm->textarea('html_content',$retval['source'] , array('style' => 'width: 100%; font-family: sans-serif;', 'class' => 'ccm-advanced-editor','rows'=>'15'))?>
</div>



Chad
Phallanx replied on at Permalink Reply
Phallanx
@ChadStrat
Just to confirm.
If you change the editor_config.php (that contains the offending definition) to type="text/javascript". Then the mail chimp addon works as expected. For the next release I will add regex to support the deprecated attribute (can't see the CC5 team changing anything soon) but the current solution is as outlined earlier. If you have other addons that are exhibiting similar problems, perhaps you can confirm that changing the editor_config.php also works for those then we can have confidence that after the next release, tiny MCE won't need to be added to the head for your addons to work.
Phallanx replied on at Permalink Reply
Phallanx
If anyone wants to see a video of (Concrete5 Vs Joomla) Vs Miser. I uploaded a video to youtube for a side-by-side comparison

(Joomla loses big time, by the way)

http://www.youtube.com/watch?v=MJshcaNextY...
nikkor replied on at Permalink Reply
nikkor
I am trying Miser on our test server ( SUSE 10 SP1, Apache 2.2.3, PHP 5.2.5, C5 5.4.1.1) and I am getting an error that I can not seem to overcome and is preventing the website from loading correctly:

Warning: fopen(/srv/www/htdocs/files/cache/css/8a95b81ddf7868abe989afe5e6ced62c_merge.css) [function.fopen]: failed to open stream: File exists in /srv/www/htdocs/helpers/miser.php on line 558

Warning: fopen(/srv/www/htdocs/files/cache/js/8d59f4a248ca20f63e77065c9aa6a205_merge.js) [function.fopen]: failed to open stream: File exists in /srv/www/htdocs/helpers/miser.php on line 558


Line 558 is:
$fp = fopen($path, "c");


Curious if you have seen this error and know what I need to do to correct it.

A little more detail on the server config:
The directories are owned by the same user that Apache is running under and the permissions on the files/cache/css & files/cache/js are 777. Safe mode is off and there is not an include_path in my php.ini.

I would really like to use Miser. So I am happy to try any suggestions and hopefully this will help the next person who runs into this issue.

Thanks,
Stuart
Phallanx replied on at Permalink Reply
Phallanx
....deleted
Phallanx replied on at Permalink Reply
Phallanx
@nikkor
OK.
I did a bit of research-Ignore my previous post.

The key points here are (great post for troubleshooting, by the way):

PHP 5.2.5
<snip>
File exists in /srv/www/htdocs/helpers/miser.php on line 558


The fopen "c" option was first introduced in PHP 5.2.6 in 2008. In 5.2.5 it's probably defaulting to the "x" option which emits a waning if the file exists and fails the fopen.

So. You will need to use the "a" option instead of "c" on line 558.

So on line 558 replace
$fp = fopen($path, "c");

with
$fp = fopen($path, "a");


In the next release I will put some defensive code in to detect this and use the appropriate method.
nikkor replied on at Permalink Reply
nikkor
Hi Phallanx,

Thank you for the quick replies, sorry for the delay in getting back to you I ended up getting called off to another task yesterday. Great catch on the PHP version, I updated to the "a" option and it did resolve the fopen errors and the homepage mostly loaded, I am seeing several images not loading and a couple of the c5 blocks are missing. I know the missing images are part of a CSS that is implemented via an @import, so I am looking at the structure there to see what I can change. I am also upgrading the OS to SP3 and PHP 5.3.6 to see if that helps resolve things, who knows maybe being on a current version could help ;-P... I will update you as I find what my other issues are.

Thanks again!

>>> Concrete5 Community <discussions@concretecms.com> 4/16/2011 11:51 AM
Phallanx replied on at Permalink Reply
Phallanx
@Nikkor.
If you are having problems with @imports then try uncommenting line 786 in view.php. That will turn off the @import combining.

$o->combine_imports(FALSE);
nikkor replied on at Permalink Reply
nikkor
@Phallanx,

After some updates to my configuration as suggested by you in this thread and Google pagespeed. I tried Miser on our production site. By applying Miser our pagespeed scores went from 71 to 90-95 ( depending on the page). So for us Miser is a big win.

I will soon be trying 1.50 and let you know if I find any thing. Thanks for the fast replies to my questions over the weekend.
Phallanx replied on at Permalink Reply
Phallanx
@nikkor
Where the @imports causing issues? (merging imports is the newest of all the features - I did some more work on them in 1.5.0)

I really need to nail those if there are any problems. @imports are blocking, therefore they are extremely detrimental to performance.

http://www.stevesouders.com/blog/2009/04/09/dont-use-import/...

Thanks for sticking with it. The more sites I can get feedback from, the more I can make the tool robust.
Phallanx replied on at Permalink Reply
Phallanx
Miser 1.5.0 has been released as of 19 April 2011.

This release addresses the following issues raised in this thread:

1. Added support for the deprecated javascript definition.
2. Added PHP version detection for fopen "c" support (fall-back to "a").

Other major changes:
1. Miser now supports more CDNS (including many of the concrete5 core javascript files).

2. Miser is no longer monolithic and now comprises of miser.php and a "miser_support" directory that contains 3rd party and CMS specific files.

3. Many Miser options can now also be configured using defines in site.php (see readme.txt section 4).
okapi replied on at Permalink Reply
okapi
I was looking forward to that update... My first impression is, that test sites are loading 1-2 seconds slowlier than with miser 1.3.0. :(
Actually i have no clue how to configure miser. The readme says "read the section on CONFIGURING MISER", but where can i find that section?
Sorry, it that's a stupid question, but this thread has become a nightmare to follow...
Michael
Phallanx replied on at Permalink Reply
Phallanx
@okapi
Apologies. That should read "Using Miser" rather than configuring
It's section 4 in the readme.txt
okapi replied on at Permalink Reply
okapi
Thank you Phallanx! I read the readme, but i still can't figure out WHERE / HOW exactly to configure these options/arguments...? Any help would be very much appreciated!
Phallanx replied on at Permalink Reply
Phallanx
@okapi
OK. Perhaps the readme is too generic. Maybe some more readme type files are needed.

Historically, You had to put the methods into the view.php. So the example methods (e.g. $o->combine_css(TRUE);) would have had to be placed in there after the "$o = Loader::helper('miser');" If you look at version1.3.1 of the view.php, you will see many of the common ones commented out that you could just uncomment to turn things on and off.

I never particularly liked that method and it is not very elegant. But now you can also place defines into the site.php which is better-but still not that happy.

So the defines can be placed in site.php, IF you want to override Misers default behaviour. There are two examples at the end of section 4 and there is a list of the currently supported defines (the labels that Miser responds to) just above.

So to turn off CSS minification (it is on by default) then place
if (!defined( 'MISER_MINIFY_CSS' ))
      define( 'MISER_MINIFY_CSS','FALSE');

in site.php.

To turn off @import processing, place
if (!defined( 'MISER_COMBINE_IMPORTS' ))
      define( 'MISER_COMBINE_IMPORTS','FALSE');

in site.php et. al.

But ideally you shouldn't need them unless there is a particular block not playing.
okapi replied on at Permalink Reply
okapi
Thank you very much for that information, Phallanx!
Michael
TheRealSean replied on at Permalink Reply
TheRealSean
Referring to images within the CSS,

I attempted to load the latest version of the miser 1.3.1 (at least I think it is)

However my previous method of referring to images has been broken

I was using url(images/image.jpg)

but get an error
Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/var/www/vhosts/myurl.co.uk/httpdocsimages/l-button.png) is not within the allowed path(s): (/var/www/vhosts/myurl.co.uk/httpdocs:/tmp) in /var/www/vhosts/myurl.co.uk/httpdocs/helpers/miser.php on line 663

I am able to get round all of these by adding the slashes to the front of the images but then the calls to the images go to themes/myTheme//images/image.jpg

I have attempted to use both getStyleSheet and getThemePath neither appear to resolve it.

I also now get the allow_call_time_pass_reference error again I can edit the htaccess to include php_flag allow_call_time_pass_reference on to get around this but am I doing something wrong?

On some of the previous versions I have been able to add the miser.php and view.php and everything just worked.

This latest one I seem to need to make changes my files to get it to work correctly, I don't know if maybe I am doing something wrong when setting the initial files up?

Thanks
Sean
Phallanx replied on at Permalink Reply
Phallanx
@seanom
The latest is 1.5.0. Is that the one you are referring to?

In 1.5.0 there is a lot more checking for paths including missing and double forward slashes so it should be impossible to get a double forward slash (famous last words).
TheRealSean replied on at Permalink Reply
TheRealSean
No I have been using 1.3.1 its a difficult task finding the latest version, Ive been sorting threads by recent first maybe I need to go back to threaded to get the latest version?

Ill give that a go thank you

**also noticed I was my initial problem post whilst you where adding the previous post grabbing the latest version now
Phallanx replied on at Permalink Reply
Phallanx
@seanom
I've resorted to page searches for keywords.
In releases I always state "Miser x.x.x" and the date of release to try and make it a little easier. Not much. but a little.

But 1.5.0 is only about 4 or 5 posts down if you are sorting by recent first. Or try searching the page for 1.5.0

Alternatively. Miser is now on source forge at

https://sourceforge.net/projects/miser/...

(If you have to edit your files. That means that "I" am doing something wrong ;)
zoinks replied on at Permalink Reply
This seems like quite an ordeal... is whatever this is about going to be included in the next version of C5? My C5 seems quite speedy now on Pair Networks, btw. My hosting was the problem on my old sites (myhosting.com... good, just not for C5, apparently).
Phallanx replied on at Permalink Reply
Phallanx
@zoinks
No. It is not going to be included in the CC5 core.
zoinks replied on at Permalink Reply
Since C5 doesn't seem slow to me on a good server, I don't understand why anyone is going to such pains to make it faster. Does C5 become a problem on highly popular sites running off more economical servers... or something?
Phallanx replied on at Permalink Reply
Phallanx
@zoinks
What is your web site address?
zoinks replied on at Permalink Reply
Here are a few:

[first one]

[second one]

[third one]

I'm working on a new one which is lightning fast because there aren't many images and no client has yet uploaded extra large images without knowing that they should be 72dpi etc. :) ... oh how I wish there was a C5 galleria script that automagically compressed images to 72dpi and gave a preview panel for compression options and cropping options.

These sites will be deleted shortly because I don't want to advertise my client's websites on these forums... not sure why, just seems poor form.
Phallanx replied on at Permalink Reply
Phallanx
@zoinks
Well.....

The sites are (I would say) average. If you are happy with them. then that's fine.The third one in particular is a good example of why people may complain that CC5 is slow, especially on virtual severs with many accounts.

This is the benchmark for that site
http://www.webpagetest.org/result/110419_2G_EKYC/1/details/...

You will notice that the red line (when the browser starts to actually render something on the page - between 2.5 to 3 seconds) is 2 seconds after the first byte is received. So a customer visiting the site is waiting for 2.7 seconds staring at nothing.

Imagine now that the connection time is 1 or 2 seconds (not unreasonable if they are on the same continent). Your customer will now wait 3 or 4 seconds before the page starts to do something.

This is a Miser optimised page.
http://www.webpagetest.org/result/110419_NC_EM2M/1/details/...

See where the red line is now (~350 ms after the first byte - note this connection time is 900 ms i.e greater than yours).
So the user sees content 300 ms after the first byte is received (1.3 secs).

So if the initial connection is 1 or 2 seconds, the user sees content in 1.3-2.3 seconds. Even though our total page time is about the same.

If you want to see it visually. Then I uploaded a video to youtube
http://www.youtube.com/watch?v=MJshcaNextY...
(it's a little difficult to see the concrete5 demo site)

This is what Miser is for. It makes a site more responsive so it seems faster.
zoinks replied on at Permalink Reply
The third one in particular is one that the client has put up huge images that are not 72dpi.

And the others are graphics-heavy, especially the first one which is a portfolio site.

The speed of the sites I linked are average or above average based on my constant use of the internet (more than 8 hours per day, sadly). Amazon, Facebook, Gmail and most of the sites I hit randomly using StumbleUpon load slower... which leads me back to the question I originally asked: since the C5 sites load perfectly fast, does the real issue have to do with a mega-popular site on a less than stellar server? If so, then I understand. Otherwise, okay, thanks for the info.

I think it's great that you've done all this work, btw. I'm not putting it down by any means. I hate how words on a screen can come across so misconstrued. I was just wondering for future use if I happen to get some wildly popular site one day if it's something I should worry about. You don't need to answer me, though. You've already spent plenty of time answering. Thanks!
Phallanx replied on at Permalink Reply
Phallanx
@zoinks
The optimised site has quite a few graphics too. As well as google adverts. They are pretty comparable (you can visit the site and take a look by clicking the top left link on the test page).

But the other thing you will notice is the web-page test scores.

For your third example it is mainly red with a score of 79.
The optimised site is mainly green with a score of 96. Without optimisation it is 82.

But anyway. That's what Miser does. If you don't need it, then great. I'm sure there are more sites without it than with. If you do, then it's here to download.
okapi replied on at Permalink Reply
okapi
While minifying html is a good thing, i don't like so much how the tool (miser 1.5.0) radically removes all spaces. Personally i prefer the traditional way of linebreaks after the brackets of html tags. I find that much more clearly laid out. Regarding performance, the saving of html spaces is negligible. I would like the "old" way of minifying html like miser 1.3.0 did.
By the way, performance is fine now.
Michael
Phallanx replied on at Permalink Reply
Phallanx
@okapi
Add
if (!defined( 'MISER_MINIFY_HTML' ))
      define( 'MISER_MINIFY_HTML',2);

to your site.php.

I'm pleased that's the only issue you have...lol

How about posting some (before and after) benchmark results?
okapi replied on at Permalink Reply
okapi
Cool! Thank you so much, Phallanx!
Yes, it's true, no issues here... :)

Some benchmarks of my simple test site (just the start page, the other pages are not public), the result is amazing:

without miser:
http://www.webpagetest.org/result/110420_G7_ET9K/...

with miser 1.5.0:
http://www.webpagetest.org/result/110420_J4_ETA3/...

I really like miser!

Michael
Phallanx replied on at Permalink Reply
Phallanx
@okapi
Sweet.
Although I've never seen it make that much difference to the total load times.

Superfish (which appears in the "slow" benchmark) is worryingly absent from the second benchmark result. I would have expected that to be replaced by a CDN.
Mnkras replied on at Permalink Reply
Mnkras
@Phallanx

have a minor issue,

when it compiles the js into 1 file, its sticking the header required stuff at the end of the file, like var CCM_IMAGE_PATH, so all the scripts that use that var are well... broken
Phallanx replied on at Permalink Reply
Phallanx
@Mnkras
Good catch.

Looks like I left an "experiment" in.

In the miser_bridge_C5.php (line 10) the following line is commented out
//$this->keys_top_footer   ( array ('var CCM_') );


It shouldn't be commented out.

$this->keys_top_footer   ( array ('var CCM_') );
Phallanx replied on at Permalink Reply
Phallanx
If you use the re-captcha mod that I've just posted on this thread

http://www.concrete5.org/community/forums/block_requests/recaptcha-...

Then you will need to add 'recaptcha' to the ignores list so that it appears in-place (otherwise it will be moved to the bottom of the page).

In miser_bridge_C5.php find on line 9
$this->keys_ignore ( array ('tony_tracker') );


And replace it with
$this->keys_ignore ( array ('tony_tracker','recaptcha') );


In future releases this will be part of the default.
nsfireschool replied on at Permalink Reply
I just wanted to briefly post a note to this thread,

I came across this ~last week and was using some material from the thread to try to tune a site I'm helping to deploy which is based on C5.

After some testing, and some help from Shaun (aka Phallanx) the site is working 'very well'.

Key take homes from tuning:
* Miser helps
* APC helps
* keepAlives is utterly critical in apache config for C5 performance
* C5 internal cache is not so much big deal in this config

I've put a somewhat verbose description together of the testing work I did in the last ~few weeks, and it is all summarized at the link below.

http://sandbox.fortechitsolutions.ca/pmwiki.php/Testing/May-2011-c5...


I hope this helps out some other C5 deployments in the future maybe.


Tim
Phallanx replied on at Permalink Reply
Phallanx
As an addendum to nsfireschools findings. I think it is worthwhile describing the symptom that lead me to suggest that he checked his keep-alive headers. Whilst it has nothing to do with Miser, the impact is severe, so recognizing the very obvious tell-tale sign should benefit others.

If you run a page benchmark at webpagetest.org you get two graphical results - the waterfall view (top result) and the connection view (after the waterfall).

The connection view for a normal website WITH keep-alive headers on will be relatively few connections and the display will show that each connection is used to download multiple pieces if the page.

->Conn1 -------<data 1>-------<data 2>-------<data 3>
->ConnA--------<data A>-------<data B>-------<data C>

A site which does not have keep-alive headers on will show a display similar to the waterfall view. There will be many bars (representing connections) and they will be staggered


->Conn1 -------<data 1>
->ConnA -------<data A>
---------------------->Conn2--------<data 2>
---------------------->ConnB -------<data B>
--------------------------------------------->Conn3--------<data 3>
--------------------------------------------->ConnC -------<data C>
As can bee seen in the second case. Connections are spawned for each request and a single connection is not re-used.
TheRealSean replied on at Permalink Reply
TheRealSean
Attempting to add this to a site I am getting an error
Warning: preg_match() [function.preg-match]: Compilation failed: unrecognized character after (? at offset 2 in /home/fhlinux163/g/mysite.co.uk/user/htdocs/helpers/miser.php on line 584

This site is running version 5.4.1.

But I am unable to run the site update as its running version 5.2.6 and shell_exec is turned off(shared hosting) infact I am having trouble doing most things on this sever including using mail() which does not work
Phallanx replied on at Permalink Reply
Phallanx
@seanom

Pregmatch warnings usually exhibit themselves when using old versions of PHP (changes/bug-fixes in the PHP functions). Miser is tested on version 5.2.x and above since that is what is specified for CC5 (5.4.1.1).

Do you have a web-address?
TheRealSean replied on at Permalink Reply
TheRealSean
@Phallanx
I have pm'd the link as I am not to sure the client would like me posting their site here.

I have managed to upgrade to 5.4.1.1 this morning also, took quite a long ftp run but got there in the end.

I am still unable to run any updates automatically or make any htaccess other then mod_rewrite so I dont know if something is turned off that needs to be on for this to work? but the PHP version is 5.2.6

Thanks
Sean
Phallanx replied on at Permalink Reply
Phallanx
@seanom
Hmmm.

Indeed you do have 5.2.6. But I notice the PCRE (Perl Compatible Regular Expressions) library is 6.6 (06-Feb-2006). I'm using the pipe function for the regex which was introduced in PCRE version 7.2 (19-Jun-07). I will add the PCRE version to the minimum requirements on the next release.

Is updating this to 7.2 or later an option?


-----------------------
woohoo. 300
TheRealSean replied on at Permalink Reply
TheRealSean
Apparently not I did ask but they said this could affect other users on the shared hosting.

http://www.streamline.net/ hosting does not appear to be compatible for miser, and not easy to use with concrete5 either
Phallanx replied on at Permalink Reply
Phallanx
@seanom
You could try Mnkras' comment earlier in this thread about the regex on line 585

Mnkras wrote:
also, for the preg_match_alls you need to remove the first ?| from them on some systems, so '#(?|href|src)="(.+)"#' would be '#(href|src)="(.+)"#'
renatoiwa replied on at Permalink Reply
Man. You are just a god! When I first installed C5 I was totally disappointed by the bad front end code. What you did is just exactly what I was looking for. Many many thanks. You deserve many awards.

Concrete5 core team: Please bundle this package with the core files. This is a must!
12345j replied on at Permalink Reply
12345j
they can't its not the same license as the core is.
Phallanx replied on at Permalink Reply
Phallanx
@renatoiwa
Sweet.
Don't forget to post some benchmarks :P

Unfortunately, Miser will probably never be included. The CC5 team have decided that they would prefer someone else re-invent the wheel from the information I have supplied in this thread as my chosen license doesn't fit their business model.
Shotster replied on at Permalink Reply
Shotster
On May 18, 2011, at 5:36 AM, Phallanx wrote:

> The CC5 team have decided that they would prefer someone else re-invent the wheel...

This is not meant to be inflammatory, but I think that's a bit of a mischaracterization. They've released an entire CMS as open source under a specific license. It would be impractical at best to have various parts of the core licensed differently.

That said, I'm curious as to your motivation behind your chosen license. Or more to the point, what is it about the C5 license that doesn't appeal to you?

-Steve
Phallanx replied on at Permalink Reply
Phallanx
@Shotster
I'm not sure what you mean by "mischaracterization" but the parting words from the CC5 team on the "Totally Random" video where:

Quote:
----------------
"Sooner or later we will get the code in a license that makes sense for us."
http://www.ustream.tv/recorded/13704193...
----------------
(Not specifically my code, but they were referring to the features that my code enables). For that, someone has to write it and the "impression" I got was that it wouldn't be the core team, although I hope they do as I have said many times in this thread.

I don't want this to degenerate into a licensing discussion. But if you want my reasoning then by all means PM me.
Shotster replied on at Permalink Reply
Shotster
> I don't want this to degenerate into a licensing discussion.

I see nothing wrong with discussing licensing (although this thread might not be the most appropriate place for it). The word "degenerate" seem to imply that there's something taboo about discussing licensing. FWIW, licensing has come up before, and I've mentioned that I'd like to see both commercial and non-commercial licensing options for the marketplace so that one could charge accordingly.

At any rate, I was just curious. I don't want to take this thread off course, since it's long enough as it is.

-Steve
frz replied on at Permalink Reply
frz
I agree with Phallanx. Open source licensing debates are pointless, no one is going to change anyone's mind on this one.

Lets have someone rewrite Miser, or lets apply our energy to some other thinking.
Shotster replied on at Permalink Reply
Shotster
> I agree with Phallanx. Open source licensing debates are pointless,
> no one is going to change anyone's mind on this one.

Sorry, my intention was not to start a debate, and I'm not interested in changing anyone's mind about anything (except maybe yours about a commercial licensing option in the marketplace, but this is not the thread for that discussion).

-Steve
Phallanx replied on at Permalink Reply
Phallanx
@Shotster.
There ya go.

Quote:
"Lets have someone rewrite Miser,"

A business opportunity for you and others. Why don't you re-write it and put it in the market place :)
Shotster replied on at Permalink Reply
Shotster
> A business opportunity for you and others. Why don't you re-write it and put
> it in the market place :)

I've been toying with the notion. It's the only way I could justify investing the time, as it doesn't solve a problem for me personally. I'm quite happy with the performance from my hosting provider.

The real question is, why don't YOU put Miser in the marketplace? Oh that's right, you'd have to change the license.

;-)

-Steve
Phallanx replied on at Permalink Reply
Phallanx
@shotster...lol

Because I don't want to SELL it. The community helped me develop it so the community can use it. But that doesn't have to mean waiving all my rights to it ;)
frz replied on at Permalink Reply
frz
I should caveat my earlier statement that we'd want to include this in the core as is if it wasn't for the license. After speaking with Andrew, that's not entirely true. It's quite likely there are things in our marketplace that would break with this installed. It's also sounds like there is some configuration to it that might bewilder our non-tech users. We want to be careful about just including it for everyone. I'm reminded of Search where there's a lot of power under the hood, but unless you know what you're doing to configure it, it feels broken. Oi. I don't need any more problems like that in life.

So what I see happening is us incorporating some of the ideas in this thread into the core with version 5.5, but not all. Consolidating some of our core JS files that are always there into one file instead of eight.. Running some minify on source before we call it an official release, etc..

The role of Miser, minifying and moving stuff that is custom for your own install, is something we'd always have to power with a configurable switch just so we don't break all the working sites out there today. Given that, and the fact that this would work as a package, I think it makes a lot of sense to have it in the marketplace.

Changing the marketplace to have commercial vs. non-commercial options strikes all of us here as very confusing for an awful lot of people, and unlikely to happen. We are adding GPL as a license option, but it's taken us 2 years to even get there. ;)
Phallanx replied on at Permalink Reply
Phallanx
@frz

Quote:
"Given that, and the fact that this would work as a package, I think it makes a lot of sense to have it in the marketplace. "

I agree whole-heartedly. This would be a "free" (as in beer) addon right? Although I think that including the package as part of the default install would be better rather than requiring people to download it just to make CC5 a bit niftier.
frz replied on at Permalink Reply
frz
You could sell it, or you could offer it for free in the marketplace.

We're also adding support for GPL in the marketplace soon (like this week). You could offer it under the GPL, and still sell it.

That would mean there'd be a "Add to Cart" button up top with a price on it that a non-tech site owner use to buy it and automatically install it. They would also be able to open a support request which you would have to address or give them a refund.

At the same time, there would be a small "Download" link in the blue box further down on the page, so a savvy developer who doesn't mind downloading the package and installing it themselves would be able to grab it for free. They would not be able to automatically install it with a project page, and would not be able to open a support request. (they could always buy a copy to get support.)

Since it's GPL, your Miser code would always be called Miser, remain credited to you, and couldn't be resold without also being distributed for free.

Perhaps that's an interesting option. It doesn't let you choose who has to pay and who doesn't, but it does create that opportunity for you to generate some revenue while still getting good stuff in everyone's hands.
Phallanx replied on at Permalink Reply
Phallanx
@frz.

Maybe I misunderstood then. I though YOU were going to make the package as part of the CC 5.5 release. That's why I was getting excited.

I've no incentive to make a package.....mine works fine as is.
frz replied on at Permalink Reply
frz
huh?

You're saying if we take the time to turn this into a package format, we can stick it in the marketplace for free under the MIT license?
Phallanx replied on at Permalink Reply
Phallanx
@frz.
Hmm.We're getting completely crossed here. No I am not saying that.My position hasn't changed.

You said
Quote:
"So what I see happening is us incorporating some of the ideas in this thread into the core with version 5.5, but not all.

you then went on to say:
Quote:
"Given that, and the fact that this would work as a package, I think it makes a lot of sense to have it in the marketplace."

I read all that as YOU were finally going to write some
NEW code (not use Miser or any portion of it) based on the IDEAS in this thread that would do some of the stuff that Miser is capable of and bundle it in a package for us in CC 5.5.

I was getting excited because my original hope (many posts ago) was that Miser would be obsoleted by YOU writing something that achieves the same (or similar) end result that Miser does, and it seemed that this was what you were saying. My dreams where coming true :)

How you got from that to your last two posts I'm not quite sure.
frz replied on at Permalink Reply
frz
I believe the post that starts:
"I should caveat my earlier statement..."

is an accurate summation of my current understanding of this thread and represents what we are most likely to do.


Moving right along.....
Phallanx replied on at Permalink Reply
Phallanx
@frz
Right. Which is where I quoted from.
Great news. So again. It will be a free package...right?
frz replied on at Permalink Reply
frz
"I think it makes a lot of sense to have it in the marketplace" is different than
"We are going to remake this and put it in the marketplace ourselves."

I'd love to see someone else do this. I'm all for you, or anyone, tackling this and either giving it away, selling it, or both.

What I can tell you we're doing is looking at some of the techniques (but not all) in this thread and incorporating them in the core. You can also assume we will be very deliberate about how much rethinking of the core we do when it might break existing sites or add-ons.

Thanks.
Phallanx replied on at Permalink Reply
Phallanx
@Shotster.

I agree.

This thread started off as documenting the development of miser and now it is stable, it is the support thread (since I have no other mechanism to offer support because of the way these forums are structured and controlled). Therefore I just don't want the "noise" of long and laborious licensing discussions diluting the technical content - it's hard enough as it is to find stuff in here.
frz replied on at Permalink Reply
frz
We like the solution here technically, looks like it's a very helpful
approach and the right way to go.

We can't include it in the core as the core is MIT licensed (meaning
free as in cost no matter who you are, or what you're doing - AND free
as in speech, no matter what you're saying).

Miser, the code that Phallanx is including as part of this performance
boon, is licensed under a custom open source license that limits free
use. I'm sure I'm grossly simplifying it, but in general terms you
would need to get approval from Phallanx before using it for anything
that isn't a non-profit.

While I have no problem with open source projects that are designed
that way, we simply are not. In my eyes this is even more restrictive
than the GPL (which simply forces a free distribution in addition to
any sales you might do). While I'm sure we could make a lot of money
at it, I'm not interested in policing what people are using their
concrete5 sites for. I also don't want to have a slow "free free"
version and a fast "free for non-profit but costs for companies"
version.

So unfortunately, as much as we do love the fact that this problem
seems to be basically solved here, we're at an impasse on getting it
to market because of the age old open source debate of what "free"
really means. The twisted irony of it is that while I'd absolutely
love for some community member to deliver some new code that does what
Miser does and can be licensed MIT or LGPL, I don't see any murmurs
that someone is doing that. So Phallanx is right. In the end, I'll
have to find the money to pay Andy to rewrite this and include it in
the core. Phallanx is right at a deeper level in that if we were
selling concrete5 to commercial folks instead of giving it away, I'd
probably have a lot of cash sitting around to make this improvement.
Regardless, I don't think we'd be where we are today under a different
license. Including some of these speed improving ideas will happen
somehow eventually because we all want concrete5 to be as fast as
possible everywhere. I can't say its something we've started however.

We are very thankful that Phallanx has taken the time to prototype a
solution that works. We're disappointed that it can't be included in
the core from a licensing structure, but we also wish the best for
Miser and Phallanx's approach.

There's your cliff-notes version. Anyone wanting to help with this
one, we'd love to see something submitted via Git..

Franz Maruna
CEO - concrete5.org
http://about.me/frz
zoinks replied on at Permalink Reply
It appears many people are interested in this and have pursued this steroidal supplementation.

So... how about a Cliffs Notes version of this thread. ;)
renatoiwa replied on at Permalink Reply
Wow! Didn't know there was all these issues with licensing :( Anyway, I'd like to thank you to have provided this solution for free (not using for commercial purpose).

@Phallanx: I have found one problem in your code. You are replacing CSS urls relative paths with full paths and that's fine, however you are forcing the use of quotes in the url statement. There is a known problem in C5 CSS parser that makes the @font-face statement not work correctly when it is using quotes (specifically for the IE fix - it puts the fix outside the quotes - "/path/to/font.eot"?iefix). (See:https://www.concrete5.org/community/forums/customizing_c5/fontface-c...

I fixed that basically by removing the quotes from miser.php line 667:

Find:
$css = str_replace( $url, '"' .$this->clean( $spath.$url_cleaned) . '"', $css );


Replace:
$css = str_replace( $url, $this->clean( $spath.$url_cleaned), $css );


Again, many thanks!
renatoiwa replied on at Permalink Reply
My bad... ignore my fix on the last post. I realized I also had to come up with a delimiter.

So I did this:

$regex = '/([\'"(])'.preg_quote($url, '/').'([\'")])/';
$css = preg_replace($regex, '\\1'. $this->clean($spath.$url_cleaned).'\\2', $css );
Phallanx replied on at Permalink Reply
Phallanx
@renatoiwa
There are many reported issues with the getStylsheet implementation. The "fix" is to use "getThemePath()" in the templates. Removing quotes can cause issues in some browsers under certain circumstances and fails W3C validation.

From a performance standpoint. @font-face is evil and should be avoided at all costs since it is blocking.
renatoiwa replied on at Permalink Reply
I agree and know the downsides of using @font-face. However, I'm working on a small website that really requires it and there's no way to avoid it (since it's small, there's no problem of keeping it).

The usage of quotes or not does not break W3C specification as they are optional:http://www.w3.org/TR/CSS21/syndata.html#uri...
Phallanx replied on at Permalink Reply
Phallanx
@renatoiwa
Hmm. When I ran the W3C checks it failed if no quotes where used - thanks for the link to clear it up. But the issue (with @font-face) is still CC5 rather than Miser (I believe) and as the algo is also used for non @font-face replacements, it's not advisable to change it.

So as you seem to be using Miser. How about some benchmarks :)
12345j replied on at Permalink Reply
12345j
I have a working copy of something similar to this. Just hammering out the last bugs now, should be available monday.
Phallanx replied on at Permalink Reply
Phallanx
To avoid confusion (and make life easier for everyone 'cos this is a monster thread).....

Please post questions, problems, support issues etc to the "Miser - Web site optiMISER" thread (the continuation of this development)

http://www.concrete5.org/community/forums/customizing_c5/miser-web-...
Phallanx replied on at Permalink Reply
Phallanx
I'll reply in here since I don't want the other thread to get bogged down again. But I'm replying to Okapis incorrect statement in the Miser thread
http://www.concrete5.org/community/forums/customizing_c5/miser-web-...

@Okapi wrote:
------------------------------
"That's the reason, why miser will never find it's way to the marketplace as an add-on, not even as a free one."
------------------------------

Actually that is not true. Anyone could make a commercial package for the market as a wrapper around Miser (it has to be a package to be accepted in the market so Miser itself cannot go in there). I could then give the package author permission to use it commercially and for them not have to "share-alike" and it (the package) can then be sold under the markets commercial license.

For non-commercial use it is free anyway.
frz replied on at Permalink Reply
frz
I'm not sure I follow. There's no "what are you going to use this for"
or "what type of organization are you" as part of the marketplace
purchase here. We now have GPL available, but we don't support selling
to some and giving to others.

best wishes

Franz Maruna
CEO - concrete5.org
http://about.me/frz
Phallanx replied on at Permalink Reply
Phallanx
@Frz.
It's quite straight forward.

I can give permission to a package author (or anyone) to distribute miser as part of their commercial package/software. In that sense, their package is a commercial derivative and can be sold under whatever license they so choose. In the case of the market place, it would have to be the CC5 commercial license since the package author has no other choice (I don't dictate that, you do).

I (as the author of Miser) have the right to waive any aspect of the licence as I see fit, purely by consent. But consent must be sought. It is not automatically granted.
frz replied on at Permalink Reply
frz
You can sell under the GPL in our marketplace and technically we can support other licenses too. What I'm not willing to do is offer something in the marketplace that costs money for some people and not for others.

Best wishes
Pecked out on an iPhone
Shotster replied on at Permalink Reply
Shotster
> What I'm not willing to do is offer something in the marketplace
> that costs money for some people and not for others.

I don't mean to butt in, but if I understand Phallanx, he's simply making a distinction between a C5 package (add-on) which incorporates the Miser code - i.e. a derivative work - and his original work.

As I understand him, a marketplace package which makes use of Miser could be sold for commercial use (with his permission), and it wouldn't necessarily even have to be called "Miser". (In fact, I suspect Phallanx might prefer, or even require, that the package name not contain the word "Miser" in order to avoid confusion and simplify support.) Under this scenario, anyone obtaining such a 3rd-party-developed package from the marketplace will have paid for it - plain and simple.

In fact, there doesn't seem to be any reason two (or more) different developers couldn't release a C5 package that uses the Miser code (again, as long as Phallanx grants permission). After all, the real challenge (since Phallanx has done the optimizer work) is going to be creating a nice UI and providing support.

Phallanx is ALSO saying that anyone can obtain the Miser source for FREE for NON-commercial use through whatever means he makes it available, just as they can now by downloading it from this forum.

So did I get that right?

:-/

-Steve
Phallanx replied on at Permalink Reply
Phallanx
@Shotster
Got it in one! ;)
frz replied on at Permalink Reply
frz
You can sell under the GPL in our marketplace and technically we can support other licenses too. What I'm not willing to do is offer something in the marketplace that costs money for some people and not for others.

Best wishes
Pecked out on an iPhone
Phallanx replied on at Permalink Reply
Phallanx
@Frz.
What you are willing to accept into the market (since you have full control over acceptance) is a different issue and has nothing to do with the terms of the licensing.

I was pointing out to Okapi, that the license I have chosen doesn't prevent a package being created using Miser (with my permission) and being sold in the market place under the CC5 commercial license.
frz replied on at Permalink Reply
frz
Pretty confusing stuff to be honest.. at least to me.

Here's what it comes down to from us:
1) If something costs money in the marketplace, it has to come with
support. If the support is mediocre, we will refund the purchase and
eventually nix the add-on.

2) Whoever submits the add-on to the marketplace takes legal
responsibility for the code that is in it and their right to
distribute it. We've had folks get explicit exceptions from original
developers to include some code under LGPL instead of GPL in the past
- which it sounds like is a bit of the type of thing you're hinting
at?

3) Whoever buys the add-on shouldn't have to scratch their head on
what they own or if they owe. It's one license per install. We don't
let everyone dream up their own fun licensing model because that makes
it very confusing for the poor customer who is just trying to improve
their website. I'm not saying that there aren't other good licensing
models out there, I'm just saying today for the sake of our customer's
sanity, we don't offer free education licenses, expensive "for-profit"
ones, or purchase by purchase grants. It's one price fits all, and if
you want to give the thing away to someone for the love, we've got
functionality built to let you grant a license for free and still use
the auto-install stuff.

These are the rules, everyone has played by them. I'm certainly all
for rethinking and breaking rules with good reason, but I'm not
understanding what or why these rules don't make sense in this case.
To be honest I'd love to see this stuff packed up in the marketplace
for free or for a price, but I'd always keep it at the Expert level
because from what I've been able to garner from this thread (longest
ever on our forums btw) is that it always takes a bit of tinkering and
it may not work with all the other add-ons. That's something we've
said we wouldn't do in the past too, but in this case I do see good
reason to bend that rule.

I wish I had a better sense of what the actual problem is with this
stuff for you, Phallanx. I feel like I sat down at a poker table
without understanding the rules or motivations with this conversation.
I don't know if your goals or concerns are. My guess is it's one of
two basic vibes:

1) Robin Hood. You want this to be free to churches and schools, but
anyone who is interested in making money should pay you something for
it, and you'd like to decide how much that is on a case by case
scenario. That's certainly happened in software before.

If that's the goal, I'm afraid we're probably stuck. You're right,
that's a personal choice I've made that all of concrete5 gets to
enjoy. ;) I just don't see a very clear line between commercial and
non-commercial use any more. My wife has a blog about sewing. She
doesn't sell anything on it, but she does link to her Etsy site.
Without the blog she wouldn't have a brand. Commercial? No? There's
hundreds of "universities" in the states that are actually for-profit
businesses.. Commercial? No? Newman's Own is a privately held company
that sells food stuff for profit, they also give 100% of that profit
to charity. I don't believe they are a 501c3, but they have given
$300million to charity since starting. Commercial? No? It's just too
confusing in my mind, you might as well make the price "call me."

2) Ownership. You want to make sure no one takes your code, calls it
Moser, and sells it for a kabillion bucks. Historically our free stuff
is MIT licensed, so that has been a valid concern. Since we launched
support for GPL in the marketplace last week, we've negated that
concern. Release it under the GPL. Make it cost some money if you
wanna get paid to answer support requests instead of doing it for free
in this thread. People who are at all technically savvy will still be
able to download it for free, and your Miser will still be your Miser
- no one will be able to pull that code out call it Moser and get rich
on reselling it... At least not without also releasing it for free..
(go GPL!)

That's the best I can muster to understand why this issue keeps coming
up. I'd love to figure out where you're coming from on this and see if
we can't find a solution that makes you happy. I don't like being
painted as a meany for wanting a coherent shopping experience for our
customers. I'm frustrated that so much energy has gone into building
this solution, but when it comes to this very practical issue of
releasing it I feel like we're playing 20 questions or something.

best wishes

Franz Maruna
CEO - concrete5.org
http://about.me/frz
Phallanx replied on at Permalink Reply
Phallanx
@Frz.
An easy explanation is that I reserve the right to choose who can and can't exploit it commercially since I'm not interested in doing it.

Your wife could use it without charge (i'd supply a waiver even though she doesn't need one). Microsoft would be refused permission point blank.
frz replied on at Permalink Reply
frz
well that does clear things up, and generally was what I was afraid of.

While I certainly respect your right to refuse service to any customer you choose, that's not how our marketplace is designed and marketed. People use concrete5 and our commercial add-ons for sites about God, people use concrete5 and our commercial add-ons for porn sites. It's not my place to choose what's good or evil. Now I might choose to refund a purchase instead of providing endless support on it for any number of reasons, and we legally can't/don't host porn sites, but in my mind this option to exclude thing is a last resort, not a starting point for a business relationship.

What if I told you my wife's blog promotes Microsoft's new awesome sewing pattern software, and she's making affiliate kickbacks on it. Now its a no-go?

I'll tell ya, the journey of going open source is philosophically fascinating. In commercial software it's not uncommon for an application to have a base license price that is pretty flexible depending on who you are. I've seen TeamSite discounted over 50% before depending on the client name. This "it costs just a bit more than you budgeted" mindset works just fine, and is certainly something I was guilty of when Concere CMS was commercial software. To me, one of the "freedoms" that going open source meant was freedom for anyone to use what we had made in anyway, regardless of what we expected or desired in the first place. Doesn't matter who you know or what you do, it costs the same for everyone.. very socialist... It's interesting to see the "how much does it cost? well who is asking and how much ya got??" mindset can still exist in open source. I've said it before and I'll say it again, Tim O'Rielly didn't really do us that big a favor by clumping so many different ideas and licenses together and calling them Open Source for the press's benefit.

I'm not writing this one with any expectations of changing your mind. It's quite likely we're both right, but we're both just worried about our own stuff and our own stuff is different. Frankly l think we both knew we were at an impasse when we started this conversation via email. I believe the analogy I made in that email still rings true. You see freedom as a fragile flower, something that needs to be protected forever with great care. I see freedom as a weed. Make sure the thing gets started okay, but then watch out and stand back, you'll never stop it. It's too bad we don't have more words to describe in detail the different things freedom means in english. Its too bad we all get clumped into "open source" when there's clearly some deep differences in both our goals and philosophies.

Certainly interesting stuff though. ;)
Phallanx replied on at Permalink Reply
Phallanx
@Frz.
Well. To begin with. CC5 isn't "open source". It is "Open Core". Nothing wrong with that, but there is a big difference in philosophies. One is free (as in beer) the other is a loss-leader to sell satellite products - a commercial strategy.

So. You would have no problem with someone forking your core (calling it say, Steroids5) then offering an integrated website that provides completely free packages, hosting, phpBB integration and Miser optimisation?

Weeds have a habit of taking over the garden and spoiling it for everyone.

You may not like the license that Miser is distributed under. But I don't think that has anything to do with licenses. I have already outlined a way for a paid package to work in the Market. Where it can never work is under the MIT license in the core. The "share-alike" restriction is far more incompatible with both of the 2 licenses you have. But no-one seems to be bothered about that.

At least you find it interesting. I find it all rather tedious and distracting since if no-one uses it, it makes no difference to me or, indeed, whether it is in the market or not. Only that if someone does use it - it works.
frz replied on at Permalink Reply
frz
I choose to find it "interesting" because the potential for frustration is so massive.

concrete5 is open source. The core is MIT licensed, which is free in every possible sense. The core is more than enough for the majority of folks. The add-ons that cost something are STILL open source, they just cost something. There's no compiled code, there's no hidden magic. The core isn't viewed as a loss leader for selling add-ons. The core is viewed as our baby, and the add-on sales help finance its development. Plenty of folks are a-okay with just the core. To deem it crippleware or a loss leader isn't fair and I don't accept that's what you really meant.

I am also aware of what it means that we're MIT licensed. Plenty of people do call our CMS something else and actively sell it. I'm okay with that. That's the price I paid for the popularity we all enjoy.

Anyrate... Like I said, its amazing how many things are called "open source" when frankly all that should really mean is "Yeah its possible to open the hood on this car"

Best wishes,
(Pecked out on a mobile device...)
http://about.me/frz
okapi replied on at Permalink Reply
okapi
@Phallanx

I totally agree with Franz.
I think it's not just my bad english that keeps me from understanding your goals...

Why actually making this whole thing that complicated? Why choosing a license variant that defines explicitly, that the use of the code on commercial websites is not allowed, while admitting at the same time, that the code may still be used on commercial websites, IF the author grants permission, and even more, the code may be actually sold (!) under a completely different license, IF the author grants permission...

I don't get the motive behind that construction:
1) there is a license, but if i ask politely, the same license would be suspended...?
2) if i ask for, i would even obtain the right to sell the code and make money...?

Michael
Phallanx replied on at Permalink Reply
Phallanx
@okapi.
I think you maybe are missing the point about what licensing is. A license is a document globally granting permission with (or without) restrictions.

The restrictions here are, if you want to use it for commercial use, you have to ask the author otherwise you cannot. If you don't want to use it commercially, then you already have permission (under the license) to "share-alike". If you don't want to share-alike, then you need, once again, to ask for permission.

So it is stipulating under what conditions you need to seek further approval, above and beyond what is stated as permitted by the license.

I could, for example, waive all restrictions and you could do anything you like with it. But only you, not everyone else. Everyone else is bound by the original license.
okapi replied on at Permalink Reply
okapi
Finally i understand. It's not about anticommercialism, as one would suggest regarding the license model you have chosen, but, as you said, it's simply about reserving the right to choose who can and who can't.
Well...

Michael
acmeinc replied on at Permalink Reply
[EDIT]miser1.5 fixed the issue, i was basing these findings on the initial version at the top of the post.

The view.php is causing a problem loading Discount Coupons (gift certs) plugin area of the dashboard. Removing view.php fixed this, but I wonder if there is a way to disable Dashboard function all together, so the fixes *only* apply to the front-end site.
Phallanx replied on at Permalink Reply
Phallanx
@acmeinc
Miser is currently at version 1.7.3. This thread was discontinued and you can now find details about Miser on the "Miser - Web site OptiMISER " thread.
http://www.concrete5.org/community/forums/customizing_c5/miser-web-...
acmeinc replied on at Permalink Reply
Thanks! Since this is quite a popular thread due to the challenges in managing Concrete5 sites on most shared hosting servers, you should consider altering the top-most post to include this information. It took a few looks over to realize you posted alterations mid-thread rather than at the top.

Thanks again. I'll be grabbing the Latest from your site.