[OzzModz] XFOptimize - Minify, Preconnect & Preload [Deleted]

Two questions:
I'm using a subdomain for 'externalDaraUrl' and 'javaScriptUrl'. This used to be a recommendation to server data/javascript from another (sub)domain to allow more simultaneous connections.
Is this still needed/recommended when using this addon?

Another thing, how can we check if the preconnect is working? If I look at the page source, I don't see any preconnect directives, but maybe this is inserted on another level?
 
May I suggest that you release it, with stating clearly that it doesn't work with UI.X skins?
It does work with UI.X. The very initial version did have some problems, but those were quickly addressed. Right now I have tested with many of the very intensive/complicated features enabled (which dump tons of JS onto the front-end) and was able to run the style with MAX minify options enabled. That being said, every site is different and there's always still a chance for some bugs. I will keep working at addressing UI.X reports until it's flawless. That's not a question. (Until I release my own lightning fast replacement for UI.X...)
Some users are reporting seeing "later_today_at_x" instead of the date and time in some messages.
I've just tested along side a few dozen new addons and I think almost all of those issues should be solved now in the incoming patch. I will continue to work with more addons until there's no more occurrances. As I've stated before, any addon that introduces malformed JS at or around the core XF stuff will cause that error.
To have had this problem before, I just unchecked the Combine inline <script> tags option and since no problem.
Yes this is the workaround for now! As that is a "high-risk" option. But my goal isn't to have lazy workarounds, I want even the high-risk options to still work as much as possible! So that's being addressed.
I just use the recommended options which are low risk. Works fine.
As more incidents are solved, more higher risk options should be able to be checked in more site setups.
 
Two questions:
I'm using a subdomain for 'externalDaraUrl' and 'javaScriptUrl'. This used to be a recommendation to server data/javascript from another (sub)domain to allow more simultaneous connections.
Is this still needed/recommended when using this addon?
The reason (well one of the big ones) you want to offload assets onto an external domain (and remember, Google and browsers treat your subdomains - ie js.sitename.com, static.sitename.com, as separate domains!) is to get past the limit of ~2 concurrent asset downloads in most browsers per domain. Basically, all your js/css/images etc on the page are grabbed in pairs of two until everything is downloaded, causing unneeded blocking.

By dividing up your assets such as the following:
  • css.sitename.com
  • js.sitename.com
  • data.sitename.com
..you could theoretically triple the download speed of your assets (though there's many under-the-hood variables on this, but that's a rough answer).
Another thing, how can we check if the preconnect is working? If I look at the page source, I don't see any preconnect directives, but maybe this is inserted on another level?

Inspect your page in your browser console, or View Page Source. Then in the head of your document, you should see a bunch of the following:
1638962225834.png

Edit: The "data-from" attribute in the preconnect tags is a hint of where the addon grabbed them from :-). Preloads also use these, and will even tell you things like "img", "script", "bg-style" 😛

This is with Preconnect Automatic Detection enabled. Honestly that part of the addon is so good, I stopped developing any sort of manual preconnect methods as it's simply unnecessary. (Except for .less template detection - but see my next reply for that!)
 
Ok guys here's an update on a major feature I hinted at earlier. The addon's FAQ says that it can't detect assets in things like less/css templates, which includes everything in the core css_urls php file loaded in every Xenforo.

To add support for the [TH] Nodes addon, I implemented a scanner which pulls all the node image URLs from TH's .less template. After next patch, that method will then be extended to the core XF less templates, which means they will also pick up on all sorts of images and things added via Style Properties :-). So [TH] Nodes is the guinea pig here.

This is a pretty big change, and I'm very happy to get it working faster than expected.
 
To add support for the [TH] Nodes addon, I implemented a scanner which pulls all the node image URLs from TH's .less template. After next patch, that method will then be extended to the core XF less templates, which means they will also pick up on all sorts of images and things added via Style Properties :). So [TH] Nodes is the guinea pig here.

This is a pretty big change, and I'm very happy to get it working faster than expected.
Great news, both UI.X and all Xenforo users 👏👏

When do you think we can get and test this great updated release ?
 
Why images in description are broken?
Very strange.. I replaced the images and works fine now. Thanks for reporting

Great news, both UI.X and all Xenforo users 👏👏

When do you think we can get and test this great updated release ?
Just solved the headache of passing the the URLs from templates via code listener up to the PAGE_CONTAINER yesterday. The next patch should be out within 48 hours for the [TH] Nodes fix - then I will hurry to extend it to the other sections for the patch after that. Should be simple since the method will already exist.
 
@Nulumia I have found 2 bug after installed and one bug should give a host fix for using in live site.

Foum list date and time only Phrases showing:

ScreenShot00458.webp

and Option page Phrases showing:

ScreenShot00459.webp
 
Foum list date and time only Phrases showing:

ScreenShot00458.png
That should be fixed in the new patch, many other users have seen it but it is fixed by disabling:
"Combine inline <script> tags"
and Option page Phrases showing:
I am likely going to remove this feature completely. The automatic preconnect detection is just that good (unless there's major issues which prevent it from working). I don't see a reason to manually/global preconnect anything if the addon can detect and preconnect them only when needed.
 
I am likely going to remove this feature completely. The automatic preconnect detection is just that good (unless there's major issues which prevent it from working). I don't see a reason to manually/global preconnect anything if the addon can detect and preconnect them only when needed.
I think this option could be useful to those running Google Ads / Adsense.

The main Google code inserted is typically just:
Code:
<script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-XXXXXXXXX" crossorigin="anonymous"></script>

Which when run makes multiple connections to additional google domains:
1) pagead2.googlesyndication.com - 10 connections average
2) googleads.g.doubleclick.net - 6 connections average
3) tpc.googlesyndication.com - 6 connections average
...along with a few others.

I could see this setting being useful for those using Google Ads / Adsense. I don't think your add-on would pick up on these domains to preconnect to since they won't be seen till the javascript is actually run, but preconnecting to them can be very beneficial. Typically at least one ad is found above the fold and can affect multiple page metrics and influence page SEO through FCP, LCP, TTI, OT and possibly others.
 
I've just tested along side a few dozen new addons and I think almost all of those issues should be solved now in the incoming patch. I will continue to work with more addons until there's no more occurrances. As I've stated before, any addon that introduces malformed JS at or around the core XF stuff will cause that error.
The fix that others offered helped... but with that said with your reply above.. you are awesome! Thank you!

Look forward to seeing your new style!
 
It does work with UI.X. The very initial version did have some problems, but those were quickly addressed. Right now I have tested with many of the very intensive/complicated features enabled (which dump tons of JS onto the front-end) and was able to run the style with MAX minify options enabled. That being said, every site is different and there's always still a chance for some bugs. I will keep working at addressing UI.X reports until it's flawless. That's not a question. (Until I release my own lightning fast replacement for UI.X...)
I was referring to "unreleased Iconify Buttons addon", which you mentioned, and that has interesting name.

But, great work. (y)
 
I was referring to "unreleased Iconify Buttons addon", which you mentioned, and that has interesting name.

But, great work. (y)
Ah I am very sorry, misunderstood. I feel it really needs to have support out the gate since so many people still use UI.X, but if it holds up the addon perhaps you're right.

On this note, the Iconify Buttons addon changes all the links above thread posts (Mark Read, Watch/Unwatch etc) to icons instead and removes the text, also similar tweaks to the page nav. Basically it makes those areas smaller and more compact UI especially for mobile.

You can also bring up the Filters as an icon too, and it moves it into that same group (then removes the filter bar). But yea no bueno in UI.X.
 
Hi there,

I noticed an incompatibility with XenAtendo. When trying to create an event, the following errors are triggered:

Code:
ErrorException: [E_NOTICE] Undefined index: host src/addons/Nulumia/XFOptimize/AssetHandler.php:321

#0 src/addons/Nulumia/XFOptimize/AssetHandler.php(321): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/var/www/vhosts...', 321, Array)
#1 src/addons/Nulumia/XFOptimize/AssetHandler.php(131): Nulumia\XFOptimize\AssetHandler::getAssetUrls(Object(DOMNodeList), 'iframe', 'finexes.com')
#2 src/addons/Nulumia/XFOptimize/Listener.php(60): Nulumia\XFOptimize\AssetHandler::processAssets('<!DOCTYPE html>...', 'EWRatendo_event...')
#3 src/XF/Extension.php(69): Nulumia\XFOptimize\Listener::appComplete(Object(XF\Pub\App), Object(XF\Http\Response))
#4 src/XF/App.php(2853): XF\Extension->fire('app_complete', Array, NULL)
#5 src/XF/App.php(2117): XF\App->fire('app_complete', Array)
#6 src/XF/Pub/App.php(455): XF\App->complete(Object(XF\Http\Response))
#7 src/XF/App.php(2354): XF\Pub\App->complete(Object(XF\Http\Response))
#8 src/XF.php(517): XF\App->run()
#9 index.php(20): XF::runApp('XF\\Pub\\App')
#10 {main}

Code:
TypeError: Argument 1 passed to Nulumia\XFOptimize\AssetHandler::checkLocalHost() must be of the type string, null given, called in /var/www/vhosts/finexes.com/httpdocs/src/addons/Nulumia/XFOptimize/AssetHandler.php on line 321 src/addons/Nulumia/XFOptimize/AssetHandler.php:370

#0 src/addons/Nulumia/XFOptimize/AssetHandler.php(321): Nulumia\XFOptimize\AssetHandler::checkLocalHost(NULL, 'finexes.com')
#1 src/addons/Nulumia/XFOptimize/AssetHandler.php(131): Nulumia\XFOptimize\AssetHandler::getAssetUrls(Object(DOMNodeList), 'iframe', 'finexes.com')
#2 src/addons/Nulumia/XFOptimize/Listener.php(60): Nulumia\XFOptimize\AssetHandler::processAssets('<!DOCTYPE html>...', 'EWRatendo_event...')
#3 src/XF/Extension.php(69): Nulumia\XFOptimize\Listener::appComplete(Object(XF\Pub\App), Object(XF\Http\Response))
#4 src/XF/App.php(2853): XF\Extension->fire('app_complete', Array, NULL)
#5 src/XF/App.php(2117): XF\App->fire('app_complete', Array)
#6 src/XF/Pub/App.php(455): XF\App->complete(Object(XF\Http\Response))
#7 src/XF/App.php(2354): XF\Pub\App->complete(Object(XF\Http\Response))
#8 src/XF.php(517): XF\App->run()
#9 index.php(20): XF::runApp('XF\\Pub\\App')
#10 {main}

I had to disable your add-on for now, otherwise my members are not able to create calendar events.
 
Two questions:
I'm using a subdomain for 'externalDaraUrl' and 'javaScriptUrl'. This used to be a recommendation to server data/javascript from another (sub)domain to allow more simultaneous connections.
Is this still needed/recommended when using this addon?

TL;DR Domain Sharding used to be an optimization technology primarily for HTTP/1 - use with care on HTTP/2 (in many cases don't do that at all)
 
Top Bottom