Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi,

    I can see the files you listed are indeed excluded from the JS Combine, but evidently there’s still one or more JS files that should also be excluded from the JS Combined file.

    What our doc tells you to do is as follows:

    1) Run your site with /?LSCWP_CTRL=before_optm and get a list of all the JS files.
    2) Put them all into the JS Excludes box.
    3) Remove one file from the list, save changes, purge all and run your site to see if the problem returns. If not, continue the trial and error process until the problem returns, at which point, put the problematic JS file back into the Excludes box and continue the process until you’ve tried out each one of them.
    4) In the end, you’ll have all the problematic file(s) left in the Excludes box and your site should run correctly.

    The trial and error process is time-consuming, but it’s the only way to make sure the problematic JS files are excluded. If you still our help, please provide the LS report number.

    Regards.

    Thread Starter popos93

    (@popos93)

    Hello,

    Thank you for your reply.

    Of course, I have excluded all JS files that loaded on my homepage. I have followed the tutorial steps very closely. In the above post, I only listed a few files just to show how I am adding the paths.

    The issue is that after adding all JS files to the exclude box, my site is still broken. This means that I can not start removing the files one by one, in order to find the culprit.

    I am not sure what you mean by LS report number.

    Hi,

    Before you do any excludes, you’re supposed to determine whether the problem is with CSS or JS by turning off the minify/combine settings, say, you turn off the CSS settings first and see if the problem goes away; if so, then the problem is with the CSS files; otherwise, it’s with the JS files. I’m really curious about your claim that the issue still persists even after you’ve put ALL the JS files in the JS Excludes box, because this could only mean the problem is not with the JS files.

    However, if you confirm that the issue goes away when you turn off the JS minify/combine settings, then it’d indicate a serious issue. And so, please go to our support site https://store.litespeedtech.com/store/submitticket.php?step=2&deptid=2 and open up a ticket, because we’d need to get onto your site to further investigate the issue.

    Thank you.

    Regards.

    Plugin Support qtwrk

    (@qtwrk)

    there are 2 fileds , one is JS exclude, another one is defer JS exclude , you need to narrow down which JS options you have issue with

    and you can also use

    wp-content
    wp-includes

    to exclude them all first, see how it goes

    Thread Starter popos93

    (@popos93)

    I managed to narrow it down to the “Load JS Deferred” setting. If I switch this option from “delayed” to “OFF” or “Deferred”, then the issues are gone. I think the problem is with some inline JS, but I don’t know how to exactly find it.

    The most important issues were that my homepage revolution slider and my main product photo on each product page would not display. So what I did was exclude my home page and /product/ pages from LS Cache optimization.

    I don’t like this and it is not the best solution for me, but it is a compromise one. I don’t know how to troubleshoot this any further honestly.

    Plugin Support qtwrk

    (@qtwrk)

    use that /?LSCWP_CTRL=before_optm query string to view original page, check its HTML source code , search for all <script , it will show the inline JS

    then find a string that is identifiable or unique to it , add into JS defer exclude list

    e.g.

    <script>
    something
    aotherline
    anotherlineofcode
    ...
    </script>

    then you can sue something to as key string to exclude it

    if it’s about revolution slider, you can things like

    rev or Rev first

    Thread Starter popos93

    (@popos93)

    So basically I need to identify the <script part of my HTML code that is related to the revolution slider, and then inside the script I need to find a word that is unique to it. Then use that word in the exclude JS box. Is my understanding correct?

    Can I just add the word as is in the exclude box and SL will know to exclude the whole script?

    Plugin Support qtwrk

    (@qtwrk)

    <script type="text/javascript">function setREVStartSize(e){
    			//window.requestAnimationFrame(function() {				 
    				window.RSIW = window.RSIW===undefined ? window.innerWidth : window.RSIW;	
    				window.RSIH = window.RSIH===undefined ? window.innerHeight : window.RSIH;	
    				try {								
    					var pw = document.getElementById(e.c).parentNode.offsetWidth,
    						newh;
    					pw = pw===0 || isNaN(pw) ? window.RSIW : pw;
    					e.tabw = e.tabw===undefined ? 0 : parseInt(e.tabw);
    					e.thumbw = e.thumbw===undefined ? 0 : parseInt(e.thumbw);
    					e.tabh = e.tabh===undefined ? 0 : parseInt(e.tabh);
    					e.thumbh = e.thumbh===undefined ? 0 : parseInt(e.thumbh);
    					e.tabhide = e.tabhide===undefined ? 0 : parseInt(e.tabhide);
    					e.thumbhide = e.thumbhide===undefined ? 0 : parseInt(e.thumbhide);
    					e.mh = e.mh===undefined || e.mh=="" || e.mh==="auto" ? 0 : parseInt(e.mh,0);		
    					if(e.layout==="fullscreen" || e.l==="fullscreen") 						
    						newh = Math.max(e.mh,window.RSIH);					
    					else{					
    						e.gw = Array.isArray(e.gw) ? e.gw : [e.gw];
    						for (var i in e.rl) if (e.gw[i]===undefined || e.gw[i]===0) e.gw[i] = e.gw[i-1];					
    						e.gh = e.el===undefined || e.el==="" || (Array.isArray(e.el) && e.el.length==0)? e.gh : e.el;
    						e.gh = Array.isArray(e.gh) ? e.gh : [e.gh];
    						for (var i in e.rl) if (e.gh[i]===undefined || e.gh[i]===0) e.gh[i] = e.gh[i-1];
    											
    						var nl = new Array(e.rl.length),
    							ix = 0,						
    							sl;					
    						e.tabw = e.tabhide>=pw ? 0 : e.tabw;
    						e.thumbw = e.thumbhide>=pw ? 0 : e.thumbw;
    						e.tabh = e.tabhide>=pw ? 0 : e.tabh;
    						e.thumbh = e.thumbhide>=pw ? 0 : e.thumbh;					
    						for (var i in e.rl) nl[i] = e.rl[i]<window.RSIW ? 0 : e.rl[i];
    						sl = nl[0];									
    						for (var i in nl) if (sl>nl[i] && nl[i]>0) { sl = nl[i]; ix=i;}															
    						var m = pw>(e.gw[ix]+e.tabw+e.thumbw) ? 1 : (pw-(e.tabw+e.thumbw)) / (e.gw[ix]);					
    						newh =  (e.gh[ix] * m) + (e.tabh + e.thumbh);
    					}				
    					if(window.rs_init_css===undefined) window.rs_init_css = document.head.appendChild(document.createElement("style"));					
    					document.getElementById(e.c).height = newh+"px";
    					window.rs_init_css.innerHTML += "#"+e.c+"_wrapper { height: "+newh+"px }";				
    				} catch(e){
    					console.log("Failure at Presize of Slider:" + e)
    				}					   
    			//});
    		  };</script>
    

    this is one of the inline that related to rev slider , you can use an identifiable/unique string from the code , to use it as exclude

    for example , I would extract setREVStartSize from the first line and use it

    Thread Starter popos93

    (@popos93)

    If I use exclude “setREVStartSize”, something is different and it seems that the slider wants to load, but it doesn’t go all the way through, so still broken. Could it be because “setREVStartSize” is located in 2 places: line 154 and 1079?

    Plugin Support qtwrk

    (@qtwrk)

    that was a quick example , there could be more inline code you need to locate

    if it located twice, then both of these inline’s will be excluded

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Exclude js not working’ is closed to new replies.