By Shaun Eislers on Monday, 09 April 2018
Posted in Technical Issues
Replies 4
Likes 0
Views 692
Votes 0
Hi guys
I recently ran an update to EasyBlog 5.2. I created a blog post however am this 413 error
"Request Entity Too Large The requested resource /administrator/index.php does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit"
Any thoughts how I can rectify?
Thanks
Shaun
I am sorry for the delay of this reply,

After we checked further on this, i suspect something related with the way you configure to use mod_pagespeed on your server, when it detect those image display on your site, it will try to optimise your page image and inject some of the pagespeed script in each of the image, for example :


<script data-pagespeed-no-defer="">(function(){var g=this;function h(b,d){var a=b.split("."),c=g;a[0]in c||!c.execScript||c.execScript("var "+a[0]);for(var e;a.length&&(e=a.shift());)a.length||void 0===d?c[e]?c=c[e]:c=c[e]={}:c[e]=d};function l(b){var d=b.length;if(0<d){for(var a=Array(d),c=0;c<d;c++)a[c]=b[c];return a}return[]};function m(b){var d=window;if(d.addEventListener)d.addEventListener("load",b,!1);else if(d.attachEvent)d.attachEvent("onload",b);else{var a=d.onload;d.onload=function(){b.call(this);a&&a.call(this)}}};var n;function p(b,d,a,c,e){this.h=b;this.j=d;this.l=a;this.f=e;this.g={height:window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight,width:window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth};this.i=c;this.b={};this.a=[];this.c={}}function q(b,d){var a,c,e=d.getAttribute("data-pagespeed-url-hash");if(a=e&&!(e in b.c))if(0>=d.offsetWidth&&0>=d.offsetHeight)a=!1;else{c=d.getBoundingClientRect();var f=document.body;a=c.top+("pageYOffset"in window?window.pageYOffset:(document.documentElement||f.parentNode||f).scrollTop);c=c.left+("pageXOffset"in window?window.pageXOffset:(document.documentElement||f.parentNode||f).scrollLeft);f=a.toString()+","+c;b.b.hasOwnProperty(f)?a=!1:(b.b[f]=!0,a=a<=b.g.height&&c<=b.g.width)}a&&(b.a.push(e),b.c[e]=!0)}p.prototype.checkImageForCriticality=function(b){b.getBoundingClientRect&&q(this,b)};h("pagespeed.CriticalImages.checkImageForCriticality",function(b){n.checkImageForCriticality(b)});h("pagespeed.CriticalImages.checkCriticalImages",function(){r(n)});function r(b){b.b={};for(var d=["IMG","INPUT"],a=[],c=0;c<d.length;++c)a=a.concat(l(document.getElementsByTagName(d[c])));if(0!=a.length&&a[0].getBoundingClientRect){for(c=0;d=a[c];++c)q(b,d);a="oh="+b.l;b.f&&(a+="&n="+b.f);if(d=0!=b.a.length)for(a+="&ci="+encodeURIComponent(b.a[0]),c=1;c<b.a.length;++c){var e=","+encodeURIComponent(b.a[c]);131072>=a.length+e.length&&(a+=e)}b.i&&(e="&rd="+encodeURIComponent(JSON.stringify(t())),131072>=a.length+e.length&&(a+=e),d=!0);u=a;if(d){c=b.h;b=b.j;var f;if(window.XMLHttpRequest)f=new XMLHttpRequest;else if(window.ActiveXObject)try{f=new ActiveXObject("Msxml2.XMLHTTP")}catch(k){try{f=new ActiveXObject("Microsoft.XMLHTTP")}catch(v){}}f&&(f.open("POST",c+(-1==c.indexOf("?")?"?":"&")+"url="+encodeURIComponent(b)),f.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),f.send(a))}}}function t(){var b={},d=document.getElementsByTagName("IMG");if(0==d.length)return{};var a=d[0];if(!("naturalWidth"in a&&"naturalHeight"in a))return{};for(var c=0;a=d[c];++c){var e=a.getAttribute("data-pagespeed-url-hash");e&&(!(e in b)&&0<a.width&&0<a.height&&0<a.naturalWidth&&0<a.naturalHeight||e in b&&a.width>=b[e].o&&a.height>=b[e].m)&&(b[e]={rw:a.width,rh:a.height,ow:a.naturalWidth,oh:a.naturalHeight})}return b}var u="";h("pagespeed.CriticalImages.getBeaconData",function(){return u});h("pagespeed.CriticalImages.Run",function(b,d,a,c,e,f){var k=new p(b,d,a,e,f);n=k;c&&m(function(){window.setTimeout(function(){r(k)},0)})});})();pagespeed.CriticalImages.Run('/ngx_pagespeed_beacon','https://www.norlense.no/administrator/index.php?option=com_easyblog&view=composer&tmpl=component&uid=131.655&Itemid=228','ej_IBtGKwC',true,false,'lHdB5OI1RfU');</script>


You can check my following screenshot as well, this is how i realised when you update the blog post again, it will stored those pagespeed script during save process then end up caused this issue is because it got a huge of POST data which contain those pagespeed script data need to save into database.

Then i Google it and I found out some other user also having this similar issue who using this Pagespeed, perhaps you can try consult with your webhosting provider who help you setup this mod_pagespeed in previously and see whether they know how to disable these pagespeed Beacon from that mod_pagespeed configuration?

For example :

Apache:

ModPagespeedCriticalImagesBeaconEnabled false


Nginx:

pagespeed CriticalImagesBeaconEnabled false;


Reference link : https://www.modpagespeed.com/doc/config_filters#beacons

Once you disabled this from your mod_pagespeed configuration, then you have to delete those image block and re-add those image from your original blog post, then press publish again, if not those pagespeed script data still included from your blog content.
·
Monday, 09 April 2018 10:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Ok thanks very much. I will investigate.

I imagine that downsampling the images should also assist.

Thanks again,

Cheers
Shaun
·
Monday, 09 April 2018 11:33
·
0 Likes
·
0 Votes
·
0 Comments
·
You're most welcome, keep us update then if this will help much you here.
·
Monday, 09 April 2018 12:35
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post