Hi, I had hosted my website on InfinityFree earlier the past year. Upon hosting, without any installations or anything, the website loaded incredibly fast as expected. But upon installing Wordpress and designing the website with Elementor, the website became very slow. The website takes around 40 seconds to open on a new device which is not acceptable. If only it is fully loaded once and loaded onto the cache, it becomes fast again. But after a few hours in which the site is unused, it becomes slow again. To try and eliminate the problem, I am using the WP Plugin W3 Total Cache. The speed after using Lazy Load, CDN and other options, has increased a bit. But like I said, the website still takes a full minute or even more to load. I need to fix this as soon as possible as I need to show my website to others who need to access it. Any help will be appreciated.
WordPress is heavy software to begin with, and adding Elementor only makes it worse. Unless you have a VPS or dedicated server, your site is going to be quite slow unless you have a lot of visitors.
Thank you for replying. Can you please give me step-by-step instructions to make a cron job do exactly that i.e Refresh the site every 5 minutes or so?
Thanks! I’ve just added the cron job as you said. But I’m a little confused about something. Running the index.php script every 5 minutes. Will refresh the website after every 5 minutes? Will this solve the issue of the site being slow?
Hi, I tested the website out for a few days after making a cron job and it seems to work sometimes. However, it is still very slow (sometimes). It seems that all the time it takes it to just get the website from the server. Once it does that, the page loads in a few seconds. Any more suggestions?
While having a cron job that loads your main page probably helps to alleviate some of the WP Cron stress, you can probably avoid it entirely by doing the following:
In your wp-config.php file, add the line define('DISABLE_WP_CRON', true);. You can put it anywhere, at the end of the file is fine.
Add a Cron Job that runs every five minutes and calls the URL wp-cron.php.
This should ensure that the background tasks are only executed by the cron job and never by a browser page load.
Important note: I’ve never actually tried this. It should work like this, but no guarantees.
Hi, so I added the other cron job alongside the first one and the website actually took a bit of time to load and even after it did, the media (images) in all the pages loaded very slowly which was never a problem before.