Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular - Server side - Initial response time is very high

enter image description here

  1. My site - https://sandbox.billionlearners.com => It is on Angular 12 SSR (running on node)

  2. Total time taken to render the page is @6secs but initial server side page take @4secs (which has size less than 200Kb)

  3. command line dig time https://sandbox.billionlearners.com takes very less time - @150ms

  4. https://tools.pingdom.com/ => even initially I do see @115KB which then changes immediately to @5MB.

  5. I also checked my server box statistics (CPU/Network/RAM etc) - not at all an issue.

  6. My CloudHosting company says - it's because of total size, which I do not believe. The whole purpose of SSR itself is defeated. I want user to see the initial page quickly and then it will load the big final page.

Whether am I missing some thing as per as SSR code is concerned OR whether there is a problem at CloudHosting end?

Thanks in advance

Update: Angular.json

...

            "styles": [
          "./node_modules/bootstrap/dist/css/bootstrap.min.css",
          "./node_modules/@fortawesome/fontawesome-free/css/all.min.css",
          "./node_modules/bootstrap-social/bootstrap-social.css",
          "./node_modules/primeicons/primeicons.css",
          "./node_modules/primeng/resources/themes/nova/theme.css",
          "./node_modules/primeng/resources/primeng.min.css",
          "./node_modules/primeflex/primeflex.min.css",
          "./node_modules/prismjs/plugins/toolbar/prism-toolbar.css",
          "./node_modules/prismjs/themes/prism-coy.css",
          "./node_modules/ngx-sharebuttons/themes/modern/modern-light-theme.scss",
          "./node_modules/ngx-owl-carousel-o/lib/styles/prebuilt-themes/owl.carousel.min.css",
          "./node_modules/ngx-owl-carousel-o/lib/styles/prebuilt-themes/owl.theme.default.min.css",
          "src/styles.scss"
        ],
        "scripts": [
          "./node_modules/jquery/dist/jquery.min.js",
          "./node_modules/bootstrap/dist/js/bootstrap.bundle.min.js",
          "./node_modules/he/he.js"
        ],
...

Index.html

  <script type="text/x-mathjax-config">
MathJax.Hub.Config({
  tex2jax: {
      inlineMath: [['$#','#$'], ['\\(','\\)']],
      processEscapes: true
      }
});
  </script>
  <script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/MathJax.js?config=TeX-AMS_CHTML"></script>
  <!--for Google reCaptch v2 -->
  <script src="https://www.google.com/recaptcha/api.js" async defer></script>
  <script src="https://checkout.razorpay.com/v1/checkout.js"> 
like image 504
user2869612 Avatar asked Jun 01 '26 03:06

user2869612


1 Answers

Basically SSR will not improve your loading speed of your webpage. But SSR makes the first page of the site to load quickly and then in background all the other stuff(including js) will load.

This will make feel like site has loaded fast. I hope your are missing something in SSR setup, that is why your static page is not loading properly.

https://angular.io/guide/universal

Suggestion:

  • Fix your SSR, so that your landing page load quickly
  • Try implement lazy loading which will give your site performance a lot
like image 135
saravana va Avatar answered Jun 02 '26 19:06

saravana va



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!