Jump to content

[Suggestion] Better JS/CSS optimization and Mobile First


SeNioR-

Recommended Posts

Hi Guys. I've tested a few different forum topics for mobile friendliness, and it turns out that many self-hosted forums don't meet the mobile-friendly requirements. It seems that Google is blocking many necessary resources (CSS Framework and JS Libraries) so such a topic is devoid of a stylesheet and does not meet the criteria for "Core Web Vitals" and has a low "Page Experience" value.

If we look for an indexed topic and check its cache version, we'll see that it doesn't have a stylesheet. Not in all cases, but in many.

I hope that v5 will be better optimized and will not load so much unnecessary code that the Googlebot is unable to handle.

Could contain: Page, Text

Could contain: Page, Text, File, WebpageCould contain: Page, Text, FileCould contain: Page, Text

BTW: In 2024, Google is expected to introduce a INP.

Could contain: Page, Text

Edited by SeNioR-
Link to comment
Share on other sites

  • Management

You just need to set up your server correctly, it's not just CSS/JS size. 

We have optimised our cloud platform to ensure CSS/JS is served via gzip and cached correctly and Google is more than happy with it.

Could contain: Page, Text, File

Could contain: File, Page, Text, Webpage

Invision Community 5 is removing a lot of redundant JS and CSS, and eventually we want to remove things like jQuery, but it will be a process, so it won't be done for 5.0.0 (or we wouldn't release for another year!). Likewise, user generated content generates a lot of DOM elements and a broad platform such as a forum needs a lot of CSS and JS. 

But just setting up your server correctly will get you passing core web vitals and fetching a solid score on Page Speed tests.

Link to comment
Share on other sites

1 hour ago, Kirill Gromov said:

Over time, does IPS migrate to pure JS or something else?

Have you tried using..."<link rel="prefetch"...." e.t.c.  for your JS?
You'll be surprised how well an JS created by IPS works...

 

Link to comment
Share on other sites

4 minutes ago, Matt said:

Native JS. Anything new in 5 is native.

Also think about this - if instead of this code

{{foreach array_unique( array_filter( \IPS\Output::i()->jsFiles ), SORT_STRING ) as $js}}
{{$js = \IPS\Http\Url::external( $js );}}
<script src='{{if $js->data['host'] == parse_url( \IPS\Settings::i()->base_url, PHP_URL_HOST )}}{expression="$js->setQueryString( 'v', \IPS\Output\Javascript::javascriptCacheBustKey() )"}{{else}}{expression="$js"}{{endif}}' data-ips></script>
<{endforeach}}

put this in include JS

{{foreach array_unique( array_filter( \IPS\Output::i()->jsFiles ), SORT_STRING ) as $js}}
{{$js = \IPS\Http\Url::external( $js );}}
<script src='{{if $js->data['host'] == parse_url( \IPS\Settings::i()->base_url, PHP_URL_HOST )}}{expression="$js->setQueryString( 'v', \IPS\Output\Javascript::javascriptCacheBustKey() )"}{{else}}{expression="$js"}{{endif}}' data-ips></script>
<link rel="prefetch" href='{{if $js->data['host'] == parse_url( \IPS\Settings::i()->base_url, PHP_URL_HOST )}}{expression="$js->setQueryString( 'v', \IPS\Output\Javascript::javascriptCacheBustKey() )"}{{else}}{expression="$js"}{{endif}}'>
{{endforeach}}

speed indicators are improving sharply ...

Link to comment
Share on other sites

19 hours ago, Matt said:

You just need to set up your server correctly, it's not just CSS/JS size. 

We have optimised our cloud platform to ensure CSS/JS is served via gzip and cached correctly and Google is more than happy with it.

Could contain: Page, Text, File

Could contain: File, Page, Text, Webpage

Invision Community 5 is removing a lot of redundant JS and CSS, and eventually we want to remove things like jQuery, but it will be a process, so it won't be done for 5.0.0 (or we wouldn't release for another year!). Likewise, user generated content generates a lot of DOM elements and a broad platform such as a forum needs a lot of CSS and JS. 

But just setting up your server correctly will get you passing core web vitals and fetching a solid score on Page Speed tests.

The result on the computer is quite good, while on mobile devices it is average at best.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
×
×
  • Create New...