Support Forum

Any suggestions with integrating cloudflare

KV kvr28
kvr28
Member

I enabled cloudflare to help with my sites speed, when I activate rocket loader which automatically asynchronously load all JavaScript resources, my page speed goes up to 98 and yslow to 95, best scores I’ve ever had, but the forum acts a little funky, the header kind of loads, then the rest of the forum renders, I’ve tried messing with the JS settings on the forum

rocket loader also messes with adsense, causing the script not to load properly etc, I did some research last night and it seems you can edit java script to bypass rocket loader

Yes. It is allowed.

 

Edit. Adcode is supposed to like something like this

 

<script data-cfasync=“false” async src=http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js></script><ins class=“adsbygoogle” style=display:inlineblock;width:728px;height:90px data-ad-client=“ca-pub-xxxxxxxxxx” data-ad-slot=“xxxxxxxxxxx”></ins><script data-cfasync=“false”>(adsbygoogle = window.adsbygoogle || []).push({});</script>

 

from this thread

https://productforums.google.com/forum/#!topic/adsense/4ii-vJsouto

I modified my adsense codes and it works flawlessly with it

can this be added to SP’s JS so they play well together?

thank-you

28 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

Not quite following… could what be added?

KV kvr28
kvr28
Member

the yellow highlighted area is the snippets added to JS to bypass the rocket loader

YS Yellow Swordfish
Yellow Swordfish
Member

Not sure how we could add that in any sensible context…
How about the custom JS side of your theme?

KV kvr28
kvr28
Member

the theme I’m using now only has a custom css area not js

KV kvr28
kvr28
Member

since I’m a glutton for punishment, what is the easiest way to find all the scripts needed to run SP in case I wanted to modify them on my staging server to see if the forum still runs good with those functions added to them

theoretically of course

YS Yellow Swordfish
Yellow Swordfish
Member

Scripts are always under the /resources/jscript/ folders. There is one under the ‘/forum’ folder and one in the root of the plugin which contains scripts used by both admin and the front end.

These are then minimised and by default the minimised/compressed versions are used by our users although we supply both the raw and compressed files.

But I am still a little unsure what it is you might add to the script libraries…

KV kvr28
kvr28
Member

me neither lol, will report back with the joy success or tears of failure :)

YS Yellow Swordfish
Yellow Swordfish
Member

Actually – I should add that it is easy to include a complete script file to be loaded using forum action hooks.

Just see how our SP plugins add script files. Its a breeze.

YS Yellow Swordfish
Yellow Swordfish
Member

Well easy enough ti explain it. But it would mean you would not have to hack core code. Well – as long as you had a custom SP theme that is.

YS Yellow Swordfish
Yellow Swordfish
Member

Well easy enough ti explain it. But it would mean you would not have to hack core code. Well – as long as you had a custom SP theme that is.

KV kvr28
kvr28
Member

I can make one, I did when I first installed SP, but since brandon did the custom theme, I got rid of it, now the custom theme doesn’t work any more so I am back to the default theme