AMP for XenForo 2.2

Will you buy it for $50 one-time fee?

  • Yes

  • No


Results are only viewable after voting.

mazzly

Well-known member
Haven't tried Cloudflare's AMP Real Url yet though
It is supposed to lower the bounce rate for AMP page visitors (according to themselves at https://www.cloudflare.com/website-optimization/amp-real-url/)
Which kinda makes sense if the url-bar shows the real url of the site you land on, instead of the "mini fake addressbar" that shows if you don't have it enabled :)
- The AMP addon I'm building actually suggests about this if the site is served through CF, but the option isn't enabled :)

just retested those urls and I can see clearly that you have a lot of room for improving non-AMP style - just optimising that could have you close to your AMP results to start with

your non-AMP has more javascript alone than the entire AMP page size! ;)

View attachment 243135

your AMP

View attachment 243136
I think the main problem here is that XF loads quite a bit of assets, that need to be manually stripped away according to your own forums' need..
And most people don't really have the know-how for what can be removed safely, and how it can be optimized.
I do it for my own sites, but then again I'm a full-stack developer also, and have quite a bit of experience doing SEO optimizations :)
 

eva2000

Well-known member
I think the main problem here is that XF loads quite a bit of assets, that need to be manually stripped away according to your own forums' need..
And most people don't really have the know-how for what can be removed safely, and how it can be optimized.
Indeed folks will work within the confines of their own know-how and experience.

Tested your posted URLs at https://xenforo.com/community/threads/amp-for-xenforo-2-2.187804/post-1483567 too and clearly from WPT the difference there was the amount of requests (particularly javascript requests) competing for cpu time on a slow emulated Moto G4 3G speed device as every other metric was close with exception of cpu busy

1609356740323.png

1609356778121.png
1609356825863.png

1609356864100.png
1609356889799.png


Non-AMP

1609356986952.png

ads !

1609357108038.png

AMP with alot less ads which made a huge different for the metrics for Time To Interactive and Total Blocking Time which are javascript heavy weighted

1609357028038.png
 
Last edited:

Masetrix

Well-known member
Indeed folks will work within the confines of their own know-how and experience.

Tested your posted URLs at https://xenforo.com/community/threads/amp-for-xenforo-2-2.187804/post-1483567 too and clearly from WPT the difference there was the amount of requests (particularly javascript requests) competing for cpu time on a slow emulated Moto G4 3G speed device as every other metric was close with excepti
...
Non-AMP

...

ads !

...

AMP with alot less ads which made a huge different for the metrics for Time To Interactive and Total Blocking Time which are javascript heavy weighted

The whole discussion is now a little too theoretical and ultimately misses the actual problem, i.e. the problem why we, who are not developers, need AMP at all.

Compare with the links you tested the speed differences between the desktop version and the mobile view.

I don't understand why the desktop version is so much faster than the mobile view, even though both have to load and display the same thing.

In order to at least compensate for that for our benefit, we have to use something like AMP. Since the AMP add-on has been running here, all values that Google shows us and what Google evaluates us have improved.

Only that counts for us who do not have the knowledge to reprogram forum software like XF and also to reprogram all the necessary addons so that they also run efficiently in the mobile view.

Greetings from us normal users with some background knowledge - compared to you developers. ;)
 

eva2000

Well-known member
I don't understand why the desktop version is so much faster than the mobile view, even though both have to load and display the same thing.

Google Lighthouse/PageSpeed insights all do mobile tests on throttled cpu device of Google Nexus 4/Motorola G4 level with 3G mobile speeds which will show drastically different result to Desktop which is unthrottled for cpu power at much higher 5Mbps net speeds in most cases. Nice write up I did about this at https://community.centminmod.com/th...ghts-and-google-core-web-vital-metrics.20735/

There's also Cost Of Javascript In 2019 by Addy Osmani

Greetings from us normal users with some background knowledge - compared to you developers

Yeah though biggest tip I can give, is if you can live with fewer ads served via AMP, then you can live with fewer ads served via non-AMP pages too :) ;) But that is all good as long as you don't mind potentially less ad revenue $$$.
 

Masetrix

Well-known member
Yeah though biggest tip I can give, is if you can live with fewer ads served via AMP, then you can live with fewer ads served via non-AMP pages too :) ;) But that is all good as long as you don't mind potentially less ad revenue $$$.

That is a mistake. The owner of the page that I have to operate as Admin wants to determine how many ADs should be switched where. HE asks me why the ADs that are loaded in the desktop view without problems and very quickly, need so much more loading time in the mobile view.

I can only answer that: Because XF first renders to the largest view size set in the style, and then everything has to be converted again on Mobileview, these differences arise.

In XF, with Autoads - which are prescribed by the operator, I have no way of determining how many ads are loaded. With AMP, however, it does.
In addition, the ads displayed by Autoads in desktop style are also loaded quickly. Why can't you turn it around on the Mobileview ...

(Googletranslate sorry ;) )
 

eva2000

Well-known member
That is a mistake. The owner of the page that I have to operate as Admin wants to determine how many ADs should be switched where. HE asks me why the ADs that are loaded in the desktop view without problems and very quickly, need so much more loading time in the mobile view.

I can only answer that: Because XF first renders to the largest view size set in the style, and then everything has to be converted again on Mobileview, these differences arise.

You need to test that theory and it doesn't hold up from my tests.

here's your non-amp page tested with 3rd party requests vs no 3rd party requests i.e. no ads etc look at Lighthouse score too 50 vs 84

with emulated Motorola G4 gen with 3G Fast 1.6Mbps speeds Chrome

non-amp + with 3rd party requests/ads where Total Blocking Time is a what is lowering your Google Lighthouse score mainly from 84 to 50

1609439804944.png

non-amp + no 3rd party

1609439854005.png
1609440037271.png

Anyway Happy New Year from Australia. 2021 is here :)

FYI, I did same test on my forums with emulated Motorola G4 gen with 3G Fast 1.6Mbps speeds Chrome

with 3rd party and Google Adsense/Analytics = 84

1609441032617.png
no 3rd party = 94

1609441109865.png

1609441171358.png
 
Last edited:

Masetrix

Well-known member
I don't know how you get these numbers / values, here in any case I would be happy if my mobile view - even without addons - came to 50+.
Without advertising, yes, with advertising, no chance with Mobilestyle.
Just forget about AMP, AMP is the result to fix a problem, the cause of which is in XF-Mobileview.
You don't seem to have really understood yet that my only concern is that XF scales so much slower in the mobile view than in the desktop style. By the way, I am not alone in this ...

The values that are achieved in the desktop view - with advertising and addons - are absolutely okay. It has to be the same in Mobileview.

Then of course it doesn't matter what a webpage test shows, I have to get along with Google and concentrate on their values (page speed). It is also completely irrelevant how a page is scaled without add-ons because these add-ons are necessary to add functionality to the page that XF does not offer in the core.

This is where amp comes in. This means that all values on Google are green (with advertising and addons) and what Google brings to our pages is increasing. That's what it's ultimately about ...

Also here from Germany a Happy New Year to Australia 2021.
New Year Quarantine GIF by Team Coco
 
Last edited:

djbaxter

Well-known member
I don't know how you get these numbers / values, here in any case I would be happy if my mobile view - even without addons - came to 50+.
Without advertising, yes, with advertising, no chance with Mobilestyle.
Just forget about AMP, AMP is the result to fix a problem, the cause of which is in XF-Mobileview.
You don't seem to have really understood yet that my only concern is that XF scales so much slower in the mobile view than in the desktop style. By the way, I am not alone in this ...

The values that are achieved in the desktop view - with advertising and addons - are absolutely okay. It has to be the same in Mobileview.
But you don't seem to understand that the same is true for websites on ANY platform, not just Xenforo - including WordPress.

And the problems are not even primarily with the platform. It's partly the way all these sites do the testing and for those like Google who like to use "real world experience" it's also the inherently slower connect speeds of mobile devices. Nothing you can do for any platform to fix the latter. We keep hearing that faster mobile speeds are coming but they are never going to be able to compete with a fast cable or fiber connection using ethernet.

I don't have an issue with anyone trying to speed up mobile page loads, anyway you want to do it. I am not personally ever going to strip my forums down to AMP where the site loses all branding and identity, and I am not going to lie awake nights trying to figure out how I can shave another half-second off mobile page loads. At a certain point, you are howling in the wind way past the point of diminishing returns.

And no matter what you do, AdSense and similar advertising networks are still going to be dragging down you page load speeds and there is little or nothing you can do about that except give up the income and stop using ad networks. Not many forum owners are going to do that and smaller and/or newer forums aren't often in a position to be able to sell and host their own ads.

Go back and re-read what @eva2000 has posted.
 

eva2000

Well-known member
re-read what @eva2000 has posted.

Well basic gist is, page speed is ultimately determined by how much javascript you serve and how/where it's served/ordered and relative to the type of device rendering the page.

Google Lighthouse/PageSpeed insights all do mobile tests on throttled cpu device of Google Nexus 4/Motorola G4 level with 3G mobile speeds which will show drastically different result to Desktop which is unthrottled for cpu power at much higher 5Mbps net speeds in most cases. Nice write up I did about this at https://community.centminmod.com/th...ghts-and-google-core-web-vital-metrics.20735/

There's also Cost Of Javascript In 2019 by Addy Osmani

AMP limits that amount of javascript to some extent, so yes page speed is better. Not saying AMP is bad or good. I'm just saying for non-AMP users, you can do the same and limit javascript somewhat and have a similar impact/performance improvement. If you find it acceptable to limit javascript in AMP, then you should be ok with limiting javascript in non-AMP too
 
Last edited:

Masetrix

Well-known member
But you don't seem to understand that the same is true for websites on ANY platform, not just Xenforo - including WordPress.
I cannot and do not want to judge that, I am only interested in XF here in the XF forum and how I can manage it so that both users and the platform that finances our free project are satisfied.

This could be achieved with vB3.8 to everyone's satisfaction without any problems. Unfortunately, vB is no longer comparable with vB3.8 and can no more be used for our requirements. (security)
XF in the core, however, does. XF today only has the problem that it lacks many small features (which have been on the wish list of users for years) and the fact that the mobile view becomes slow when it needs the same performance as the desktop view.
 

eva2000

Well-known member
mobile view becomes slow when it needs the same performance as the desktop view.
might want to read https://community.centminmod.com/threads/cost-of-javascript-in-2019-by-addy-osmani.19218/ or original page https://v8.dev/blog/cost-of-javascript-2019 mobile view page speed can be related to the type of mobile device doing the rendering + speed and latency of mobile networks. But a big factor is javascript ultimately.

and quote bold enlarged text highlighted and reason why AMP helps (as does reducing amount of javascript on non-AMP pages)

  • Improve download time
    • Keep your JavaScript bundles small, especially for mobile devices. Small bundles improve download speeds, lower memory usage, and reduce CPU costs.
    • Avoid having just a single large bundle; if a bundle exceeds ~50–100 kB, split it up into separate smaller bundles. (With HTTP/2 multiplexing, multiple request and response messages can be in flight at the same time, reducing the overhead of additional requests.)
    • On mobile you’ll want to ship much less especially because of network speeds, but also to keep plain memory usage low.
  • Improve execution time
    • Avoid Long Tasks that can keep the main thread busy and can push out how soon pages are interactive. Post-download, script execution time is now a dominant cost.
  • Avoid large inline scripts (as they’re still parsed and compiled on the main thread). A good rule of thumb is: if the script is over 1 kB, avoid inlining it (also because 1 kB is when code caching kicks in for external scripts).

Why does download and execution time matter?​

Why is it important to optimize download and execution times? Download times are critical for low-end networks. Despite the growth in 4G (and even 5G) across the world, our effective connection types remain inconsistent with many of us running into speeds that feel like 3G (or worse) when we’re on the go.

JavaScript execution time is important for phones with slow CPUs. Due to differences in CPU, GPU, and thermal throttling, there are huge disparities between the performance of high-end and low-end phones. This matters for the performance of JavaScript, as execution is CPU-bound.

In fact, of the total time a page spends loading in a browser like Chrome, anywhere up to 30% of that time can be spent in JavaScript execution.
 
Last edited:

Masetrix

Well-known member
Well basic gist is, page speed is ultimately determined by how much javascript you serve and how/where it's served/ordered and relative to the type of device rendering the page.



AMP limits that amount of javascript to some extent, so yes page speed is better. Not saying AMP is bad or good. I'm just saying for non-AMP users, you can do the same and limit javascript somewhat and have a similar impact/performance improvement. If you find it acceptable to limit javascript in AMP, then you should be ok with limiting javascript in non-AMP too
Here too you think too small.
If I cut off javascript functionality in my mobile view, then many of the necessary functions are missing that users need who have a fast connection and want to use these functions.
If users have to use the site that connects to the Internet with ~3G, I can offer these sites that are fast with AMP, whereby the missing functionality is a compromise.

Without AMP and with a missing JS functionality, I have to restrict all users of our site, which is not wanted and with AMP is not necessary at all. Everyone has the opportunity to decide for themselves whether they need speed or all functionality. This rewards Google, so AMP is necessary as long as the mobile view from XF does not scale as quickly as the desktop view by default.
 

eva2000

Well-known member
If I cut off javascript functionality in my mobile view, then many of the necessary functions are missing that users need who have a fast connection and want to use these functions.
If users have to use the site that connects to the Internet with ~3G, I can offer these sites that are fast with AMP, whereby the missing functionality is a compromise.
To be clear, I am not saying blindly removing javascript native to Xenforo. I'm talking about 3rd party javascript. Over the years I've reduced my 3rd party javascript footprint to improve performance without impacting Xenforo or Wordpress sites. Going from 1,500+ KB to under 800+ KB helps. Yes AMP can do the same for you too just you have less control over the process.
 

mazzly

Well-known member
I don't have an issue with anyone trying to speed up mobile page loads, anyway you want to do it. I am not personally ever going to strip my forums down to AMP where the site loses all branding and identity, and I am not going to lie awake nights trying to figure out how I can shave another half-second off mobile page loads. At a certain point, you are howling in the wind way past the point of diminishing returns.
With the AMP addon I've been making you are not really giving up much of the "original look/branding" of the site. The non-AMP and AMP pages look very similar, the only major part where it is "noticeable" (if you would open and compare) is the logo position and navbar button. Otherwise everything else is almost identical :) For someone landing on your site from a search engine, it doesn't matter. If they start interacting with your site, they will use the real site anyway :)

And no matter what you do, AdSense and similar advertising networks are still going to be dragging down you page load speeds and there is little or nothing you can do about that except give up the income and stop using ad networks. Not many forum owners are going to do that and smaller and/or newer forums aren't often in a position to be able to sell and host their own ads.
Yes ads are always going to lower the score.

The Pagespeed scores are anyway just an indicator, so try to bring it up as high as possible (without ads) and then add the ads (if you want to monetize).
The added benefit with AMP is that the ads will also be AMP pages, and can't load megabytes of JS that will hog down the main thread.

We keep hearing that faster mobile speeds are coming but they are never going to be able to compete with a fast cable or fiber connection using ethernet.
never say never :)

I get a 12ms roundtrip latency and 290 mpbs downlink speed straight into my phone, could get 600 or 1000mbps if I paid 5/15€ more per month on my contract :)

But yeah, mobile connection speed in 99% of the world is quite bad, and in developing countries and the like people won't have high-end phones etc etc.. Maybe the Starlink satellites will help with connection speed soon, one can always hope :)

Until then we just need to focus on bringing the page load times down instead :)

Going from 1,500+ KB to under 800+ KB helps. Yes AMP can do the same for you too just you have less control over the process.
On my site with the AMP addon installed and ads enabled, it now loads 728kB of AMP JS, so that is extra JS trimming you could have.
Not to mention that the AMP JS is alo optimized to try and be lightweight, something that can't be guaranteed with non-AMP JS :)

Disabling ads, the loaded JS size is 543kB, and If I removed the analytics it would be a further 98kB saved :D

Cheers!
 

mazzly

Well-known member
We have now released our AMPXF addon:

 
Top