Hi all,
I noticed that my sites losts a lot of time loading js e css file. I
searched for a solution and I found this great rails plugin:
http://www.artweb-design.de/2007/4/13/rails-plugin-blazing-fast-page-loads-through-bundled-css-and-javascript
but I don’t know how can I use it in radiant.
I tried to export it in vendor/plugins and modifing config/routes.rb as
explained… but I’ve produced only an Application error…
Any suggestion?
bYe!
Andrea
On 11/6/07, Andrea O. [email protected] wrote:
Hi all,
I noticed that my sites losts a lot of time loading js e css file. I
searched for a solution and I found this great rails plugin:
http://www.artweb-design.de/2007/4/13/rails-plugin-blazing-fast-page-loads-through-bundled-css-and-javascript
but I don’t know how can I use it in radiant.
I usually create a radiant page called javascripts that loops through
its children…each children it’s a js page…then from my layout a
call only one js file (/javascripts) that contains all my js code. It
should be cool to add a new Filter that use jsminifier to compress all
the code…what do you think?
Andrea F. wrote:
On 11/6/07, Andrea O. [email protected] wrote:
Hi all,
I noticed that my sites losts a lot of time loading js e css file. I
searched for a solution and I found this great rails plugin:
http://www.artweb-design.de/2007/4/13/rails-plugin-blazing-fast-page-loads-through-bundled-css-and-javascript
but I don’t know how can I use it in radiant.
I usually create a radiant page called javascripts that loops through
its children…each children it’s a js page…then from my layout a
call only one js file (/javascripts) that contains all my js code. It
should be cool to add a new Filter that use jsminifier to compress all
the code…what do you think?
Normally I take js & css as separated static file. I use radiant as cms
for my clients… and so I prefer to leave basic layout css and js file
not editable. 
jsminifier is only a small compressing “utility”… it clear spacing and
unusefull chars only. The real plus about using the plugin I’ve posted
before is that it gzip files on the fly! 
Take a look at this site: http://www.indiaandmore.com
I have:
12kb xhtml code
14kb css code
170kb image file (huge, I know
but are the same for all the site)
25kb swf (I use sfir for graphical texts)
174kb of js file!!!
With that plugin I think it could be shrinked at 20/30 kb size with
ease…
Andrea F. wrote:
I usually create a radiant page called javascripts that loops through
its children…each children it’s a js page…then from my layout a
call only one js file (/javascripts) that contains all my js code. It
should be cool to add a new Filter that use jsminifier to compress all
the code…what do you think?
Not sure about it but would it not make sense to push the JS and CSS out
to a file? Or create a bundle into public or compress it all and then
put it into public?
Or am I missing something here? Of course, this requires that you have
access to public rather just through the admin. (but then page
attachments could help there).
Cheers,
Mohit.
11/6/2007 | 8:18 PM.
Mohit S. wrote:
Andrea F. wrote:
I usually create a radiant page called javascripts that loops through
its children…each children it’s a js page…then from my layout a
call only one js file (/javascripts) that contains all my js code. It
should be cool to add a new Filter that use jsminifier to compress all
the code…what do you think?
Not sure about it but would it not make sense to push the JS and CSS out
to a file? Or create a bundle into public or compress it all and then
put it into public?
Or am I missing something here? Of course, this requires that you have
access to public rather just through the admin. (but then page
attachments could help there).
Cheers,
Mohit.
11/6/2007 | 8:18 PM.
It depends… Franz’s solution is good if you manage the site yourself
only… you can change all the site through admin, without ftp or
anything else.
My solution it’s safer when different peoples can access the admin
interface.
But… now… we are OT…

Normally I take js & css as separated static file. I use radiant as cms
for my clients… and so I prefer to leave basic layout css and js file
not editable. 
Yes, if it is for your clients its better to use normal javascript file

jsminifier is only a small compressing “utility”… it clear
spacing and
unusefull chars only. The real plus about using the plugin
I’ve posted
before is that it gzip files on the fly! 
If you have your javascript in a static file, your webserver
should be doing the compressing with gzip on the fly if it is
configured correctly. The doco you linked explicitely states
that the pluging DOESN’T provide compression, only compaction,
and the it relies on mod_deflate for compression. Your apache
server is not currently configured with mod_deflate.
All pages served through the radiant should also be gzipped
on the fly when your webserver is correctly configured.
But back to your original question - there’s no reason why
that plugin couldn’t work in theory - if you dig into your
logs and look at the real error behind the 500 app error,
you should be able to get it running.
Dan.
Daniel S. wrote:
If you have your javascript in a static file, your webserver
should be doing the compressing with gzip on the fly if it is
configured correctly. The doco you linked explicitely states
that the pluging DOESN’T provide compression, only compaction,
and the it relies on mod_deflate for compression. Your apache
server is not currently configured with mod_deflate.
Dan.
My actual hoster (hostingrails) doesn’t support mod_deflate because it
has high impact on server’s performance…