[Lift] Re: Speeding load time; liftAjax.js and other javascript minified?

2009-07-10 Thread marius d.

liftAjax is dynamically generated and it does not represent static
content. Please see ScriptRenderer.scala. However is is a pretty small
script so I'm not sure how much we'll actually fain by minifying it.
Can you run a benchmark? Take from the browser the generated script,
minify it and the serve it statically to browser and see how much are
we saving.


Br's,
Marius

On Jul 10, 11:00 am, DFectuoso santiago1...@gmail.com wrote:
 I dont know how liftAjax.js is generated, or if it changes or not,
 also I have no idea (if it regenerated) how it could be minified, and
 I know that minification seem like a micro-optimization but...

 With just GZipping and Javascript minification working together, the
 load time dropped from 16 seconds to just under 10 seconds. I was
 absolutely extactic at the progress I was making so for and so was my
 client!http://www.site-reference.com/articles/Website-Development/YSlow-Help...

 For Google an increase in page load time from 0.4 second to 0.9
 seconds decreased traffic and ad revenues by 20%. For Amazon every 100
 ms increase in load times decreased sales with 
 1%.http://www.svennerberg.com/2008/12/page-load-times-vs-conversion-rates/

 So, analyzing a couple of lift apps with YSlow I find a couple of
 things that could be done to improve the average load time. Of course
 there's a lot of impact on how you do your css, where you host css and
 images(and how), compresion, server configuration, javascript and css
 performance and a lot of things on the application side; but it would
 be nice to make everything possible on the framework side to create
 that culture around every lift app =)

 So I wanted to throw that idea here and see how to help in this
 matter.

 Ideas?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Speeding load time; liftAjax.js and other javascript minified?

2009-07-10 Thread Timothy Perrett

Hey,

liftAjax.js is not regenerated dynamically as far as im aware... By
default, lift ships with the maven plugin for YUI compressor, so that
should minify the CSS/JS in your webapp dir.

Perhaps we should try and minify liftAjax.js during the build of
lift... marius is probally the best man for this as this stuff is
pretty much his baby.

Cheers, Tim

On Jul 10, 9:00 am, DFectuoso santiago1...@gmail.com wrote:
 I dont know how liftAjax.js is generated, or if it changes or not,
 also I have no idea (if it regenerated) how it could be minified, and
 I know that minification seem like a micro-optimization but...

 With just GZipping and Javascript minification working together, the
 load time dropped from 16 seconds to just under 10 seconds. I was
 absolutely extactic at the progress I was making so for and so was my
 client!http://www.site-reference.com/articles/Website-Development/YSlow-Help...

 For Google an increase in page load time from 0.4 second to 0.9
 seconds decreased traffic and ad revenues by 20%. For Amazon every 100
 ms increase in load times decreased sales with 
 1%.http://www.svennerberg.com/2008/12/page-load-times-vs-conversion-rates/

 So, analyzing a couple of lift apps with YSlow I find a couple of
 things that could be done to improve the average load time. Of course
 there's a lot of impact on how you do your css, where you host css and
 images(and how), compresion, server configuration, javascript and css
 performance and a lot of things on the application side; but it would
 be nice to make everything possible on the framework side to create
 that culture around every lift app =)

 So I wanted to throw that idea here and see how to help in this
 matter.

 Ideas?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Speeding load time; liftAjax.js and other javascript minified?

2009-07-10 Thread marius d.

Tim, sorry but I have to say that liftAjax.js IS generated dynamically
as I stated above :). It is not a script sitting somewhere but it
ultimately comes from ScriptRenderer.scala

Br's,
Marius

On Jul 10, 11:26 am, Timothy Perrett timo...@getintheloop.eu wrote:
 Hey,

 liftAjax.js is not regenerated dynamically as far as im aware... By
 default, lift ships with the maven plugin for YUI compressor, so that
 should minify the CSS/JS in your webapp dir.

 Perhaps we should try and minify liftAjax.js during the build of
 lift... marius is probally the best man for this as this stuff is
 pretty much his baby.

 Cheers, Tim

 On Jul 10, 9:00 am, DFectuoso santiago1...@gmail.com wrote:

  I dont know how liftAjax.js is generated, or if it changes or not,
  also I have no idea (if it regenerated) how it could be minified, and
  I know that minification seem like a micro-optimization but...

  With just GZipping and Javascript minification working together, the
  load time dropped from 16 seconds to just under 10 seconds. I was
  absolutely extactic at the progress I was making so for and so was my
  client!http://www.site-reference.com/articles/Website-Development/YSlow-Help...

  For Google an increase in page load time from 0.4 second to 0.9
  seconds decreased traffic and ad revenues by 20%. For Amazon every 100
  ms increase in load times decreased sales with 
  1%.http://www.svennerberg.com/2008/12/page-load-times-vs-conversion-rates/

  So, analyzing a couple of lift apps with YSlow I find a couple of
  things that could be done to improve the average load time. Of course
  there's a lot of impact on how you do your css, where you host css and
  images(and how), compresion, server configuration, javascript and css
  performance and a lot of things on the application side; but it would
  be nice to make everything possible on the framework side to create
  that culture around every lift app =)

  So I wanted to throw that idea here and see how to help in this
  matter.

  Ideas?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Speeding load time; liftAjax.js and other javascript minified?

2009-07-10 Thread Jeppe Nejsum Madsen

DFectuoso santiago1...@gmail.com writes:

 I dont know how liftAjax.js is generated, or if it changes or not,
 also I have no idea (if it regenerated) how it could be minified, and
 I know that minification seem like a micro-optimization but...


[...]

 So, analyzing a couple of lift apps with YSlow I find a couple of
 things that could be done to improve the average load time. Of course
 there's a lot of impact on how you do your css, where you host css and
 images(and how), compresion, server configuration, javascript and css
 performance and a lot of things on the application side; but it would
 be nice to make everything possible on the framework side to create
 that culture around every lift app =)

I've been thinking about this for some time and may get around to
implement it at some point, but it doesn't have top priority for me atm,
so I'll just share the ideas here:

There are a number of situations that revolves around this:

- Minifying JS  CSS files (gzip can be handled by the frontend I
  think?)
- To minimize requests, the Expires-Date should be set way into the
  future. How do we ensure client always get the right file when changing?
- Many CSS  JS files can be combined into a single file for better performance
  for first time visitors (this doesn't work for all files so some kind
  of exception list needs to be maintained)
- Using a CDN for distribution of static files 

So to sketch the idea:

- In templates/html all requests for JS or CSS resources should be via a
  lift tag, e.g: lift:javascript src=/classpath/jquery.js/ and
  lift:css href=/css/main.css

- In development mode, Lift would just generate the corresponding tags
  for easy debugging
- In production mode, Lift would minify the resource (and cache of
  course) and generate the tags, but the MD5 sum of the file appended to
  the URL. This way, we ensure that clients will always reload the
  resource if it changes even if the Expires date is set into the future
- In the advanced scenario, multiple files can be combined into a single
  file (i.e. all css files can be combined to a single, minified
  version), all javascript files could be combined. These files should
  probably be generated (and cached) dynamically since different pages
  may need different resources
- If configured, the resources could be served via a CDN by just
  generating the correct URL

Thoughts?


/Jeppe

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Speeding load time; liftAjax.js and other javascript minified?

2009-07-10 Thread DFectuoso

Ok, i got my tools ready; but I am too tired so i'll run them
tomorrow...
Right now i did 2 different minifications on dfectuoso.com/liftAjax/
test1.html and test2.html in test.html its the liftAjax file we all
use... so, im probably going to run a couple hundred hits on each one
and see if theres any change; but im going to use (on each one)
diferent versions of jQuery, just cause i love statistics...

I'll keep you guys updated

On Jul 10, 1:51 am, Timothy Perrett timo...@getintheloop.eu wrote:
 My bad marius... your reply must have gone in just before mine (I
 didnt read it before sending mine!)

 Cheers, Tim

 On Jul 10, 9:33 am, marius d. marius.dan...@gmail.com wrote:

  Tim, sorry but I have to say that liftAjax.js IS generated dynamically
  as I stated above :). It is not a script sitting somewhere but it
  ultimately comes from ScriptRenderer.scala

  Br's,
  Marius

  On Jul 10, 11:26 am, Timothy Perrett timo...@getintheloop.eu wrote:

   Hey,

   liftAjax.js is not regenerated dynamically as far as im aware... By
   default, lift ships with the maven plugin for YUI compressor, so that
   should minify the CSS/JS in your webapp dir.

   Perhaps we should try and minify liftAjax.js during the build of
   lift... marius is probally the best man for this as this stuff is
   pretty much his baby.

   Cheers, Tim

   On Jul 10, 9:00 am, DFectuoso santiago1...@gmail.com wrote:

I dont know how liftAjax.js is generated, or if it changes or not,
also I have no idea (if it regenerated) how it could be minified, and
I know that minification seem like a micro-optimization but...

With just GZipping and Javascript minification working together, the
load time dropped from 16 seconds to just under 10 seconds. I was
absolutely extactic at the progress I was making so for and so was my
client!http://www.site-reference.com/articles/Website-Development/YSlow-Help...

For Google an increase in page load time from 0.4 second to 0.9
seconds decreased traffic and ad revenues by 20%. For Amazon every 100
ms increase in load times decreased sales with 
1%.http://www.svennerberg.com/2008/12/page-load-times-vs-conversion-rates/

So, analyzing a couple of lift apps with YSlow I find a couple of
things that could be done to improve the average load time. Of course
there's a lot of impact on how you do your css, where you host css and
images(and how), compresion, server configuration, javascript and css
performance and a lot of things on the application side; but it would
be nice to make everything possible on the framework side to create
that culture around every lift app =)

So I wanted to throw that idea here and see how to help in this
matter.

Ideas?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---



[Lift] Re: Speeding load time; liftAjax.js and other javascript minified?

2009-07-10 Thread DFectuoso

I kinda knew that coz i did a very fast search for a file called
liftAjax.js... just wanted to be sure! And now I am...

Why don't you guys let me run some benchmarks before actually
investing some time on this? (but keep talking about this subject tho,
nothing bad can come from exploring how to do faster lift apps! )

On Jul 10, 1:33 am, marius d. marius.dan...@gmail.com wrote:
 Tim, sorry but I have to say that liftAjax.js IS generated dynamically
 as I stated above :). It is not a script sitting somewhere but it
 ultimately comes from ScriptRenderer.scala

 Br's,
 Marius

 On Jul 10, 11:26 am, Timothy Perrett timo...@getintheloop.eu wrote:

  Hey,

  liftAjax.js is not regenerated dynamically as far as im aware... By
  default, lift ships with the maven plugin for YUI compressor, so that
  should minify the CSS/JS in your webapp dir.

  Perhaps we should try and minify liftAjax.js during the build of
  lift... marius is probally the best man for this as this stuff is
  pretty much his baby.

  Cheers, Tim

  On Jul 10, 9:00 am, DFectuoso santiago1...@gmail.com wrote:

   I dont know how liftAjax.js is generated, or if it changes or not,
   also I have no idea (if it regenerated) how it could be minified, and
   I know that minification seem like a micro-optimization but...

   With just GZipping and Javascript minification working together, the
   load time dropped from 16 seconds to just under 10 seconds. I was
   absolutely extactic at the progress I was making so for and so was my
   client!http://www.site-reference.com/articles/Website-Development/YSlow-Help...

   For Google an increase in page load time from 0.4 second to 0.9
   seconds decreased traffic and ad revenues by 20%. For Amazon every 100
   ms increase in load times decreased sales with 
   1%.http://www.svennerberg.com/2008/12/page-load-times-vs-conversion-rates/

   So, analyzing a couple of lift apps with YSlow I find a couple of
   things that could be done to improve the average load time. Of course
   there's a lot of impact on how you do your css, where you host css and
   images(and how), compresion, server configuration, javascript and css
   performance and a lot of things on the application side; but it would
   be nice to make everything possible on the framework side to create
   that culture around every lift app =)

   So I wanted to throw that idea here and see how to help in this
   matter.

   Ideas?

--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
Lift group.
To post to this group, send email to liftweb@googlegroups.com
To unsubscribe from this group, send email to 
liftweb+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en
-~--~~~~--~~--~--~---