Thanks for the response. I have added the s2Member CSS to my W3TC minified CSS which combines and minifies all CSS on a page so that there are less HTTP requests. This should cut down page load time by a couple hundred milliseconds. That may not seem like a lot, but it is when load times are just a few thousand milliseconds. So that's an easy way to address the CSS performance today.
In terms of JavaScript, I certainly understand why it needs to be dynamic with all the user data in the file. I reviewed the JavaScript and have a two suggestions that I believe are the "lowest hanging fruit" that would speed up performance:
1. Easiest. Provide an admin option to relocate the <script> tag to the template footer. Based on my review of the code, this wouldn't hinder a "stock" setup of s2Member since all your execution takes place using jQuery's document.ready() anyway. If an admin is using custom scripting that uses the S2MEMBER_* variables, then they would have the option to have the JS remain in the header. Or they could wrap their code in a jQuery document.ready() function. This would only improve page rendering time and not page load time, so Google ranking would not be increased, IIRC.
2. Better. Provide an admin option to load s2Member's JS asynchronously. This would require two minimal changes to the existing setup:
(a) In the itself (possibly user-configured for header or footer insertion), adding some scripting like this:
- Code:
<script>
jQuery(document).ready(function(){
jQuery.getScript( "/?ws_plugin__s2member_js_w_globals....");
});
</script>
(b) In the s2Member dynamic JavaScript generator, move the form initialization code out of the jQuery(document).ready() calls since the document is already ready.
This would offer great performance gains in terms of the page load time since the loading would be done asynchronously. In my setup, this would remove another few hundred milliseconds out of the page load pipeline. When combined with the CSS caching, it should speed up page load by at least half a second.Statistics: Posted by wiseeyesmedia — June 25th, 2011, 2:07 pm
]]>