Support » Plugin: PWA » manifest loads slowly

  • Resolved aakrealtor

    (@aakrealtor)


    I ran a test on my home page using GTmetrix and I discovered in the waterfall that the PWA manifest file loads in a minimum of 1 second and at times over 3 seconds. Is there anything that can be done to speed that up?

    You can see what I am talking about by opening the waterfall in this link:
    https://gtmetrix.com/reports/www.ocalahomes.online/beq5adpQ

    Thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    The manifest is served by the WordPress REST API. On your site, the endpoint is https://www.ocalahomes.online/wp-json/wp/v2/web-app-manifest

    If this is slow, then this indicates there is a general slowness with your site’s REST API. For example getting a single post is taking awhile: https://www.ocalahomes.online/wp-json/wp/v2/posts/11118?_fields=title

    So this is not an issue specifically with the PWA plugin.

    Thread Starter aakrealtor

    (@aakrealtor)

    I am far from an expert in technical matters like this. However, from what I read, the best indication of a slow REST API is a slow TTFB. But GTmetrix reports my TTFB is in the range of 140-240ms, which is very fast. Also, I compared your PWA plugin to Super Progressive Web Apps. Only yours displays the manifest loading slowly issue. Finally, since your manifest loads on every page and blog post on my site, tests show that it slows every page down. Would you be willing to take a look at your code and see if there is an issue that can be resolved. If you are then still convinced that this is not your plugin’s issue, would you be willing to help me find a solution at my end. Again, when using your competitor’s PWA plugin I detect no speed issues. Thanks in advance.

    Plugin Author Weston Ruter

    (@westonruter)

    As I shared above, the REST API responds slowly even for the posts endpoint. So the slowness is not caused by the PWA plugin.

    I suggest posting on the general support forum about debugging REST API performance problems.

    Thread Starter aakrealtor

    (@aakrealtor)

    Weston,

    I did a little investigating and here is what I found:

    (1) The one file that has been loading slowly on my blog pages is https://www.ocalahomes.online/wp-admin/admin-ajax.php. This file averages about 3.0 seconds to load. However, I could find nothing in the literature that pointed to the Rest API as a possible cause. The file is primarily used by the WordPress Heart Beat feature. Therefore, the most common fixes recommended were to reduce use of the file by Heart Beat and, if necessary, troubleshoot other plugins that use Ajax. In doing the troubleshooting, I discovered that the plugin I use to generate my blog pages was the cause. When I deactivated it, the ajax.php file loaded instantly. However, that plugin allows me to load all blog pages, both mobile and not, in AMP mode. Since the AMP blog pages fully load in 800ms on average and I don’t use non-AMP blog pages, I reactivated the blog plugin.

    (2) That brings me to the issue of your PWA plugin. As I mentioned before, the SuperPWA plugin loads without the slow loading manifest file issue. For various reasons I like your plugin better and would love to use it. But I can’t justify the sacrifice of page load speed. If you do ever resolve the manifest loading issue, please let me know. I would be excited to start using your plugin again.

    Thank you,
    Andy

    Plugin Author Weston Ruter

    (@westonruter)

    Please determine why this REST API response is slow: https://www.ocalahomes.online/wp-json/wp/v2/posts/11118?_fields=title

    That will determine why the Web App Manifest response is slow.

    Thread Starter aakrealtor

    (@aakrealtor)

    Hi Weston.

    I have some info you may be interested in and a solution to this issue. While the main problem with my blog pages was the fact that when admin-ajax.php loads it tries to load all of the WordPress code first, there was a REST API problem caused by the fact that your manifest file was loading with the blog pages as well. I corrected the admin-ajax.php problem by adding a code to that file requiring that it only load the minimum required WordPress resources. That reduced the load time for that file by up to 75%. As for the issue with the REST API, it turned out that the issue was caused by the hosting company. I have a shared Hostgator account and get fantastic load speeds, but it requires a little more work to accomplish that. To overcome that issue I needed to cache all json files. I tried WP REST Cache, but the plugin didn’t solve my issue and the developer was nowhere near as responsive as you. Then, with a little research, I discovered that I could create a rule within Cloudflare to cache json files. Bingo! That took less than a minute and now your file loads in less than 100ms. Awesome and easy solution!

    @aakrealtor

    Can you provide more details on your fixes? I am having the IDENTICAL problem and I also use Hostgator shared hosting.

    1) How did you correct the admin-ajax file so that it only loaded minimal WP resources?
    2) What work or tweaks did you do to get great load speeds on Hostgator, especially around the REST API?

    If you can point me to the web site or any research you did that would be great. I can usually figure most of it out.

    Thank you in advance,
    Bill

    Thread Starter aakrealtor

    (@aakrealtor)

    (1) My blogging plugin uses the admin-Ajax file for one particular feature only. Since I don’t use the feature, I simple deactivated it so that the file does not load at all.

    (2) As for the REST API, it uses JS and Hostgator does not handle the API well. The solution is to cache JS and take the load off of Hostgator. You can do that with the REST API coaches plugin, but I found it easier to simple create a rule within Cloudflare to cache JS. I already used Cloudflare as my CDN.

    Thread Starter aakrealtor

    (@aakrealtor)

    That should read “REST API Cache”.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.