WordPress Troubleshooting
Solutions to common issues with WordPress Web Push Implementation
This guide explains the most common issue with using the WordPress plugin - the website server slows down or the website becomes unreachable when a notification is sent.
For all other issues with web push, refer to our Web Push Troubleshooting guide.
Whenever you notice that the website goes down or becomes unresponsive whenever a notification is sent, this is mainly due to the fact that the website server is unable to handle the load of the number of notifications being sent.
It is critical to understand that for every single campaign that you schedule (either from the iZooto panel or using the WP plugin), there would be multiple notifications sent which would be equal to the total number of subscribers that you have. Let's say, for example, if you have 200k subscribers for your website, then, every campaign will result in sending 200k notifications to the individual subscribers.
The typical web push implementation using the iZooto WordPress plugin uses the below service worker file as a query parameter to deliver notifications:
The above file is referenced and called whenever a new notification (ad or content) is sent for your website. Since the service worker file is added as a query parameter, this increases the load on the website every time a notification is sent due to which you may face issues related to the website becoming unresponsive.
Going back to the example stated above, what this means is that whenever a campaign is sent, about 200k notifications would be sent and the service worker would be referenced 200k times to successfully deliver the notifications. This, in turn, increases the load on the website making the website unresponsive.
Steps to Resolve
Manually Hosting the service-worker.js
file
service-worker.js
fileThe best way to resolve this is by hosting the service-worker.js
file (available under Settings > Setup > Install > Step 2 on the iZooto panel) directly to the root directory of the website such that the file is accessible as:
Once the above change is done, please send an email to [email protected] so that the team can make backend changes to start referring the manually hosted service worker file.
This should lower the CPU and memory usage as users return back to your website; however, this will be a slow process as it depends entirely on the repeat traffic of your website. You will need to ensure that the WP plugin is kept active even after the file is hosted manually so that the existing subscribers can be migrated to the new manually hosted service worker configuration.
Server Capacity Planning
It is also recommended that you plan your server capacity so as to better and efficiently manage the available memory. Efficient server capacity planning will also help to increase the CPU and memory usage for your website.
Since the service worker file is hosted directly on the website and is referenced every time a notification is sent, the hits on the website will increase in accordance with the number of active subscribers who receive the notification. For example, if the notification is received by 200k users, then you will receive 200k hits on your website which will increase the load on the website if the capacity is not managed properly.
For any other issues or queries, please reach out to [email protected].
Updated over 2 years ago