WordPress WP Rocket
INFO
WP Rocket is a performance optimization plugin for websites built on the WordPress platform. This plugin helps increase website loading speed by optimizing elements like cache, CSS and JavaScript files, images, and others. WP Rocket provides a simple user interface for configuring and managing optimization settings, making it possible for users to improve site performance without needing to be an expert in programming or administration. system.
Enable Nginx configuration for WP Rocket
Make sure the
WP Rocket
plugin is installed in WordPress AdminReturn to the
FlashPanel
site dashboard, click theNginx WordPress Rocket
tilePress the
Enabe
buttonConfirm results
- Open the browser, press
F12
to open the Development Tools panel, select theNetwork
tab - Enter your website address
- If you see
X-Rocket-Nginx-Serving-Static: HIT
is OK
- Open the browser, press
Configure WP-Cron
WARNING
Once WP Rocket is configured, when the user accesses, the files the user receives are cached files without having to execute any PHP from WordPress, which can cause failed jobs. Your scheduler is not called. As you may already know, WP-Cron jobs are not true cron jobs and are only executed when you have visits to your site.
To ensure your scheduled tasks run when needed, we recommend that you disable WordPress cron jobs and create a true cron job.
Open the
wp-config.php
file furtherphpdefine( 'DISABLE_WP_CRON', true );
Open CronJobs tab and add
You add the following:
- Command:
cd /home/flashvps/main3.chungnguyen.xyz; php8.2 wp-cron.php
in which/home/flashvps/main3.chungnguyen.xyz
you change to the corresponding pathphp8.2
is the current php version being used for this website. - User: corresponds to the user of the current website
- Cron Expression: in minute, change to
*/15
- Command:
Press the
Create CronJob
button