javascript - JS compression - PageSpeed (Google Chrome report) -


i'm running pagespeed google chrome extension check performance of webpage. believe have got compressed js file (see attached code) report says can compressed again 59% reduction. missing here?

update: using play framework. can done using require.js optimizer?

enter image description here

/*  requirejs 2.0.4 copyright (c) 2010-2012, dojo foundation rights reserved.  available via mit or new bsd license.  see: http://github.com/jrburke/requirejs details */ var requirejs,require,define; (function(y){function x(b){return j.call(b)==="[object function]"}function g(b){return j.call(b)==="[object array]"}function q(b,c){if(b){var e;for(e=0;e<b.length;e+=1)if(b[e]&&c(b[e],e,b))break}}function n(b,c){if(b){var e;for(e=b.length-1;e>-1;e-=1)if(b[e]&&c(b[e],e,b))break}}function y(b,c){for(var e in b)if(b.hasownproperty(e)&&c(b[e],e))break}function k(b,c,e,i){c&&y(c,function(c,j){if(e||!b.hasownproperty(j))i&&typeof c!=="string"?(b[j]||(b[j]={}),k(b[j],c,e,i)):b[j]=c});return b}function s(b, c){return function(){return c.apply(b,arguments)}}function z(b){if(!b)return b;var c=y;q(b.split("."),function(b){c=c[b]});return c}function $(b,c,e){return function(){var i=fa.call(arguments,0),g;if(e&&x(g=i[i.length-1]))g.__requirejsbuild=!0;i.push(c);return b.apply(null,i)}}function aa(b,c,e){q([["tourl"],["undef"],["defined","requiredefined"],["specified","requirespecified"]],function(i){var g=i[1]||i[0];b[i[0]]=c?$(c[g],e):function(){var b=z[o];return b[g].apply(b,arguments)}})}function h(b, c,e,i){c=error(c+"\nhttp://requirejs.org/docs/errors.html#"+b);c.requiretype=b;c.requiremodules=i;if(e)c.originalerror=e;return c}function ga(){if(i&&i.readystate==="interactive")return i;n(document.getelementsbytagname("script"),function(b){if(b.readystate==="interactive")return i=b});return i}var ha=/(\/\*([\s\s]*?)\*\/|([^:]|^)\/\/(.*)$)/mg,ia=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,ba=/\.js$/,ja=/^\.\//,j=object.prototype.tostring,a=array.prototype,fa=a.slice,ka=a.splice,w=!!(typeof window!== "undefined"&&navigator&&document),ca=!w&&typeof importscripts!=="undefined",la=w&&navigator.platform==="playstation 3"?/^complete$/:/^(complete|loaded)$/,o="_",s=typeof opera!=="undefined"&&opera.tostring()==="[object opera]",z={},p={},p=[],l=!1,j,t,c,u,d,i,e,da,ea;if(typeof define==="undefined"){if(typeof requirejs!=="undefined"){if(x(requirejs))return;p=requirejs;requirejs=void 0}typeof require!=="undefined"&&!x(require)&&(p=require,require=void 0);j=requirejs=function(b,c,e,i){var g=o,r;!g(b)&& typeof b!=="string"&&(r=b,g(c)?(b=c,c=e,e=i):b=[]);if(r&&r.context)g=r.context;(i=z[g])||(i=z[g]=j.s.newcontext(g));r&&i.configure(r);return i.require(b,c,e)};j.config=function(b){return j(b)};require||(require=j);j.version="2.0.4";j.jsextregexp=/^\/|:|\?|\.js$/;j.isbrowser=w;a=j.s={contexts:z,newcontext:function(b){function c(a,d,o){var l=d&&d.split("/"),f=l,b=k.map,c=b&&b["*"],e,g,h;if(a&&a.charat(0)===".")if(d){f=k.pkgs[d]?l=[d]:l.slice(0,l.length-1);d=a=f.concat(a.split("/"));for(f=0;d[f];f+= 1)if(e=d[f],e===".")d.splice(f,1),f-=1;else if(e==="..")if(f===1&&(d[2]===".."||d[0]===".."))break;else f>0&&(d.splice(f-1,2),f-=2);f=k.pkgs[d=a[0]];a=a.join("/");f&&a===d+"/"+f.main&&(a=d)}else a.indexof("./")===0&&(a=a.substring(2));if(o&&(l||c)&&b){d=a.split("/");for(f=d.length;f>0;f-=1){g=d.slice(0,f).join("/");if(l)for(e=l.length;e>0;e-=1)if(o=b[l.slice(0,e).join("/")])if(o=o[g]){h=o;break}!h&&c&&c[g]&&(h=c[g]);if(h){d.splice(0,f,h);a=d.join("/");break}}}return a}function e(a){w&&q(document.getelementsbytagname("script"), function(d){if(d.getattribute("data-requiremodule")===a&&d.getattribute("data-requirecontext")===h.contextname)return d.parentnode.removechild(d),!0})}function i(a){var d=k.paths[a];if(d&&g(d)&&d.length>1)return e(a),d.shift(),h.undef(a),h.require([a]),!0}function g(a,d,o,b){var f=a?a.indexof("!"):-1,v=null,e=d?d.name:null,g=a,i=!0,j="",k,m;a||(i=!1,a="_@r"+(n+=1));f!==-1&&(v=a.substring(0,f),a=a.substring(f+1,a.length));v&&(v=c(v,e,b),m=n[v]);a&&(v?j=m&&m.normalize?m.normalize(a,function(a){return c(a, e,b)}):c(a,e,b):(j=c(a,e,b),k=h.nametourl(j)));a=v&&!m&&!o?"_unnormalized"+(o+=1):"";return{prefix:v,name:j,parentmap:d,unnormalized:!!a,url:k,originalname:g,isdefine:i,id:(v?v+"!"+j:j)+a}}function r(a){var d=a.id,o=m[d];o||(o=m[d]=new h.module(a));return o}function p(a,d,o){var b=a.id,f=m[b];if(n.hasownproperty(b)&&(!f||f.defineemitcomplete))d==="defined"&&o(n[b]);else r(a).on(d,o)}function b(a,d){var b=a.requiremodules,l=!1;if(d)d(a);else if(q(b,function(d){if(d=m[d])d.error=a,d.events.error&&(l= !0,d.emit("error",a))}),!l)j.onerror(a)}function u(){p.length&&(ka.apply(f,[f.length-1,0].concat(p)),p=[])}function t(a,d,b){a=a&&a.map;d=$(b||h.require,a,d);aa(d,h,a);d.isbrowser=w;return d}function z(a){delete m[a];q(m,function(d,b){if(d.map.id===a)return m.splice(b,1),d.defined||(h.waitcount-=1),!0})}function a(a,d){var b=a.map.id,l=a.depmaps,f;if(a.inited){if(d[b])return a;d[b]=!0;q(l,function(a){if(a=m[a.id])return!a.inited||!a.enabled?(f=null,delete d[b],!0):f=a(a,k({},d))});return f}}function c(a, d,b){var l=a.map.id,f=a.depmaps;if(a.inited&&a.map.isdefine){if(d[l])return n[l];d[l]=a;q(f,function(f){var f=f.id,c=m[f];!q[f]&&c&&(!c.inited||!c.enabled?b[l]=!0:(c=c(c,d,b),b[f]||a.definedepbyid(f,c)))});a.check(!0);return n[l]}}function d(a){a.check()}function e(){var a=k.waitseconds*1e3,d=a&&h.starttime+a<(new date).gettime(),b=[],l=!1,f=!0,c,g,j;if(!t){t=!0;y(m,function(a){c=a.map;g=c.id;if(a.enabled&&!a.error)if(!a.inited&&d)i(g)?l=j=!0:(b.push(g),e(g));else if(!a.inited&&a.fetched&&c.isdefine&& (l=!0,!c.prefix))return f=!1});if(d&&b.length)return a=h("timeout","load timeout modules: "+b,null,b),a.contextname=h.contextname,b(a);f&&(q(m,function(a){if(!a.defined){var a=a(a,{}),d={};a&&(c(a,d,{}),y(d,d))}}),y(m,d));if((!d||j)&&l)if((w||ca)&&!u)u=settimeout(function(){u=0;e()},50);t=!1}}function v(a){r(g(a[0],null,!0)).init(a[1],a[2])}function j(a){var a=a.currenttarget||a.srcelement,d=h.onscriptload;a.detachevent&&!s?a.detachevent("onreadystatechange",d):a.removeeventlistener("load",d, !1);d=h.onscripterror;a.detachevent&&!s||a.removeeventlistener("error",d,!1);return{node:a,id:a&&a.getattribute("data-requiremodule")}}var k={waitseconds:7,baseurl:"./",paths:{},pkgs:{},shim:{}},m={},w={},f=[],n={},r={},n=1,o=1,m=[],t,x,h,q,u;q={require:function(a){return t(a)},exports:function(a){a.usingexports=!0;if(a.map.isdefine)return a.exports=n[a.map.id]={}},module:function(a){return a.module={id:a.map.id,uri:a.map.url,config:function(){return k.config&&k.config[a.map.id]||{}},exports:n[a.map.id]}}}; x=function(a){this.events=w[a.id]||{};this.map=a;this.shim=k.shim[a.id];this.depexports=[];this.depmaps=[];this.depmatched=[];this.pluginmaps={};this.depcount=0};x.prototype={init:function(a,d,b,l){l=l||{};if(!this.inited){this.factory=d;if(b)this.on("error",b);else this.events.error&&(b=s(this,function(a){this.emit("error",a)}));this.depmaps=a&&a.slice(0);this.depmaps.rjsskipmap=a.rjsskipmap;this.errback=b;this.inited=!0;this.ignore=l.ignore;l.enabled||this.enabled?this.enable():this.check()}},definedepbyid:function(a, d){var b;q(this.depmaps,function(d,f){if(d.id===a)return b=f,!0});return this.definedep(b,d)},definedep:function(a,d){this.depmatched[a]||(this.depmatched[a]=!0,this.depcount-=1,this.depexports[a]=d)},fetch:function(){if(!this.fetched){this.fetched=!0;h.starttime=(new date).gettime();var a=this.map;if(this.shim)t(this,!0)(this.shim.deps||[],s(this,function(){return a.prefix?this.callplugin():this.load()}));else return a.prefix?this.callplugin():this.load()}},load:function(){var a=this.map.url;r[a]|| (r[a]=!0,h.load(this.map.id,a))},check:function(a){if(this.enabled&&!this.enabling){var d=this.map.id,b=this.depexports,c=this.exports,f=this.factory,e;if(this.inited)if(this.error)this.emit("error",this.error);else{if(!this.defining){this.defining=!0;if(this.depcount<1&&!this.defined){if(x(f)){if(this.events.error)try{c=h.execcb(d,f,b,c)}catch(g){e=g}else c=h.execcb(d,f,b,c);if(this.map.isdefine)if((b=this.module)&&b.exports!==void 0&&b.exports!==this.exports)c=b.exports;else if(c===void 0&&this.usingexports)c= this.exports;if(e)return e.requiremap=this.map,e.requiremodules=[this.map.id],e.requiretype="define",b(this.error=e)}else c=f;this.exports=c;if(this.map.isdefine&&!this.ignore&&(n[d]=c,j.onresourceload))j.onresourceload(h,this.map,this.depmaps);delete m[d];this.defined=!0;h.waitcount-=1;h.waitcount===0&&(m=[])}this.defining=!1;if(!a&&this.defined&&!this.defineemitted)this.defineemitted=!0,this.emit("defined",this.exports),this.defineemitcomplete=!0}}else this.fetch()}},callplugin:function(){var a= this.map,d=a.id,b=g(a.prefix,null,!1,!0);p(b,"defined",s(this,function(b){var f=this.map.name,e=this.map.parentmap?this.map.parentmap.name:null;if(this.map.unnormalized){if(b.normalize&&(f=b.normalize(f,function(a){return c(a,e,!0)})||""),b=g(a.prefix+"!"+f,this.map.parentmap,!1,!0),p(b,"defined",s(this,function(a){this.init([],function(){return a},null,{enabled:!0,ignore:!0})})),b=m[b.id]){if(this.events.error)b.on("error",s(this,function(a){this.emit("error",a)}));b.enable()}}else f=s(this,function(a){this.init([], function(){return a},null,{enabled:!0})}),f.error=s(this,function(a){this.inited=!0;this.error=a;a.requiremodules=[d];y(m,function(a){a.map.id.indexof(d+"_unnormalized")===0&&z(a.map.id)});b(a)}),f.fromtext=function(a,d){var b=l;b&&(l=!1);r(g(a));j.exec(d);b&&(l=!0);h.completeload(a)},b.load(a.name,t(a.parentmap,!0,function(a,d){a.rjsskipmap=!0;return h.require(a,d)}),f,k)}));h.enable(b,this);this.pluginmaps[b.id]=b},enable:function(){this.enabled=!0;if(!this.waitpushed)m.push(this),h.waitcount+= 1,this.waitpushed=!0;this.enabling=!0;q(this.depmaps,s(this,function(a,d){var b,c;if(typeof a==="string"){a=g(a,this.map.isdefine?this.map:this.map.parentmap,!1,!this.depmaps.rjsskipmap);this.depmaps[d]=a;if(b=q[a.id]){this.depexports[d]=b(this);return}this.depcount+=1;p(a,"defined",s(this,function(a){this.definedep(d,a);this.check()}));this.errback&&p(a,"error",this.errback)}b=a.id;c=m[b];!q[b]&&c&&!c.enabled&&h.enable(a,this)}));y(this.pluginmaps,s(this,function(a){var b=m[a.id];b&&!b.enabled&& h.enable(a,this)}));this.enabling=!1;this.check()},on:function(a,b){var c=this.events[a];c||(c=this.events[a]=[]);c.push(b)},emit:function(a,b){q(this.events[a],function(a){a(b)});a==="error"&&delete this.events[a]}};return h={config:k,contextname:b,registry:m,defined:n,urlfetched:r,waitcount:0,defqueue:f,module:x,makemodulemap:g,configure:function(a){a.baseurl&&a.baseurl.charat(a.baseurl.length-1)!=="/"&&(a.baseurl+="/");var b=k.pkgs,c=k.shim,e=k.paths,f=k.map;k(k,a,!0);k.paths=k(e,a.paths,!0);if(a.map)k.map= k(f||{},a.map,!0,!0);if(a.shim)y(a.shim,function(a,b){g(a)&&(a={deps:a});if(a.exports&&!a.exports.__buildready)a.exports=h.makeshimexports(a.exports);c[b]=a}),k.shim=c;if(a.packages)q(a.packages,function(a){a=typeof a==="string"?{name:a}:a;b[a.name]={name:a.name,location:a.location||a.name,main:(a.main||"main").replace(ja,"").replace(ba,"")}}),k.pkgs=b;y(m,function(a,b){a.map=g(b)});if(a.deps||a.callback)h.require(a.deps||[],a.callback)},makeshimexports:function(a){var b;return typeof a==="string"? (b=function(){return z(a)},b.exports=a,b):function(){return a.apply(y,arguments)}},requiredefined:function(a,b){var c=g(a,b,!1,!0).id;return n.hasownproperty(c)},requirespecified:function(a,b){a=g(a,b,!1,!0).id;return n.hasownproperty(a)||m.hasownproperty(a)},require:function(a,d,c,e){var f;if(typeof a==="string"){if(x(d))return b(h("requireargs","invalid require call"),c);if(j.get)return j.get(h,a,d);a=g(a,d,!1,!0);a=a.id;return!n.hasownproperty(a)?b(h("notloaded",'module name "'+a+'" has not been loaded yet context: '+ b)):n[a]}c&&!x(c)&&(e=c,c=void 0);d&&!x(d)&&(e=d,d=void 0);for(u();f.length;)if(f=f.shift(),f[0]===null)return b(h("mismatch","mismatched anonymous define() module: "+f[f.length-1]));else v(f);r(g(null,e)).init(a,d,c,{enabled:!0});e();return h.require},undef:function(a){var b=g(a,null,!0),c=m[a];delete n[a];delete r[b.url];delete w[a];if(c){if(c.events.defined)w[a]=c.events;z(a)}},enable:function(a){m[a.id]&&r(a).enable()},completeload:function(a){var b=k.shim[a]||{},c=b.exports&&b.exports.exports, e,f;for(u();f.length;){f=f.shift();if(f[0]===null){f[0]=a;if(e)break;e=!0}else f[0]===a&&(e=!0);v(f)}f=m[a];if(!e&&!n[a]&&f&&!f.inited)if(k.enforcedefine&&(!c||!z(c)))if(i(a))return;else return b(h("nodefine","no define call "+a,null,[a]));else v([a,b.deps||[],b.exports]);e()},tourl:function(a,b){var e=a.lastindexof("."),g=null;e!==-1&&(g=a.substring(e,a.length),a=a.substring(0,e));return h.nametourl(c(a,b&&b.id,!0),g)},nametourl:function(a,b){var c,e,f,g,h,i;if(j.jsextregexp.test(a))g=a+(b|| "");else{c=k.paths;e=k.pkgs;g=a.split("/");for(h=g.length;h>0;h-=1)if(i=g.slice(0,h).join("/"),f=e[i],i=c[i]){g(i)&&(i=i[0]);g.splice(0,h,i);break}else if(f){c=a===f.name?f.location+"/"+f.main:f.location;g.splice(0,h,c);break}g=g.join("/")+(b||".js");g=(g.charat(0)==="/"||g.match(/^[\w\+\.\-]+:/)?"":k.baseurl)+g}return k.urlargs?g+((g.indexof("?")===-1?"?":"&")+k.urlargs):g},load:function(a,b){j.load(h,a,b)},execcb:function(a,b,c,e){return b.apply(e,c)},onscriptload:function(a){if(a.type==="load"|| la.test((a.currenttarget||a.srcelement).readystate))i=null,a=j(a),h.completeload(a.id)},onscripterror:function(a){var b=j(a);if(!i(b.id))return b(h("scripterror","script error",a,[b.id]))}}}};j({});aa(j);if(w&&(t=a.head=document.getelementsbytagname("head")[0],c=document.getelementsbytagname("base")[0]))t=a.head=c.parentnode;j.onerror=function(b){throw b;};j.load=function(b,c,e){var i=b&&b.config||{},g;if(w)return g=i.xhtml?document.createelementns("http://www.w3.org/1999/xhtml","html:script"):document.createelement("script"), g.type=i.scripttype||"text/javascript",g.charset="utf-8",g.async=!0,g.setattribute("data-requirecontext",b.contextname),g.setattribute("data-requiremodule",c),g.attachevent&&!(g.attachevent.tostring&&g.attachevent.tostring().indexof("[native code")<0)&&!s?(l=!0,g.attachevent("onreadystatechange",b.onscriptload)):(g.addeventlistener("load",b.onscriptload,!1),g.addeventlistener("error",b.onscripterror,!1)),g.src=e,e=g,c?t.insertbefore(g,c):t.appendchild(g),e=null,g;else ca&&(importscripts(e),b.completeload(c))}; w&&n(document.getelementsbytagname("script"),function(b){if(!t)t=b.parentnode;if(u=b.getattribute("data-main")){if(!p.baseurl)d=u.split("/"),da=d.pop(),ea=d.length?d.join("/")+"/":"./",p.baseurl=ea,u=da;u=u.replace(ba,"");p.deps=p.deps?p.deps.concat(u):[u];return!0}});define=function(b,c,e){var i,g;typeof b!=="string"&&(e=c,c=b,b=null);g(c)||(e=c,c=[]);!c.length&&x(e)&&e.length&&(e.tostring().replace(ha,"").replace(ia,function(b,e){c.push(e)}),c=(e.length===1?["require"]:["require","exports","module"]).concat(c)); if(l&&(i=e||ga()))b||(b=i.getattribute("data-requiremodule")),g=z[i.getattribute("data-requirecontext")];(g?g.defqueue:p).push([b,c,e])};define.amd={jquery:!0};j.exec=function(b){return eval(b)};j(p)}})(this); 

the file looking @ minimised (a form of compression produces valid code in fewer characters). pagespeed talking gzip compression compresses file smaller version not valid code , has decompressed on client before executing. without knowing more server setup, can't tell how enable pretty simple. google [insert server tech here] gzip compression


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -