- Tempat Nongkrong Para GIRILAYA mania -


You are not connected. Please login or register

Topik sebelumnya Topik selanjutnya Go down  Message [Halaman 1 dari 1]

1Optimasi Wordpress dengan Cron Job Empty Optimasi Wordpress dengan Cron Job Thu 11 Jul 2013, 12:25

Admin

Admin
Admin
Admin
WordPress comes with a built in automation function called wp_cron. It is used for various WP maintenance (updates check etc.), to publish scheduled posts that are created with a date in the future, and by many plugins with automated features, such as autoblogging plugins.

Though wp_cron is not perfect. You might have seen missed schedules already if you use them. This is because wp_cron is not actually a cron job, but rather a "pseudo cron job" that fires when a page is loaded (i.e., when you get a visitor to your site.)
When someone visits you site, wp_cron is fired during page load, and checks the database to see if there is any pending action to take. Thus if you don't get visits during a given period, any scheduled actions will not be triggered.
Another issue is that when someone comes to your site and there are pending action, running them during page load can increase the page load time (which is not good for user experience).

Here's a simple tweak to replace wp_cron with a real CRON job to solve these issues.

PART 1: Disabling wp_cron.

#1 - Using your FTP program or file manager in cPanel, download the file called wp-config.php (located at the root of your WP installation)
#2 - Open wp-config.php with a text editor and paste the following line anywhere
(if not sure, you can paste this below define('DB_COLLATE', ''); ) :
Code:
define('DISABLE_WP_CRON', true);
#3 - Upload wp-config.php back to your server.

PART 2: Setting a real CRON job to replace wp_cron

#4 - In your cPanel, go to "cron jobs".
Optimasi Wordpress dengan Cron Job Cpanel-cron1_zpsec50a24a

#5 - Under the "add new cron job" section, choose a 15 minutes interval (this setting offers the best performance)
Optimasi Wordpress dengan Cron Job Cpanel-cron2_zps025c6800

#6 - In the "command" field, paste the following line (just change YOURWEBSITE.COM with the actual URL of your WP site!)
Code:
wget -q -O - [You must be registered and logged in to see this link.] >/dev/null 2>&1
#7 - Click "Add New Cron Job" and you're done!
Optimasi Wordpress dengan Cron Job Cpanel-cron3_zpsa874b7b0

That's it, you've just replaced wp_cron with a real CRON job!
No more missed schedules, and you have optimized your site speed on every page load!

http://forum.girilaya.com

Topik sebelumnya Topik selanjutnya Kembali Ke Atas  Message [Halaman 1 dari 1]

Permissions in this forum:
Anda tidak dapat menjawab topik

Ping your blog, website, or RSS feed for Free
ping fast  my blog, website, or RSS feed for Free

 

pagerank analyzerW3 Directory - the World Wide Web Directory

© 2014 Copyright Girilaya Real Groups - All Rights Reserved | Back to Top