Now here’s what happened to me last night. Follow me closely, as this will explain why you might get a very specific error message upon activating the plugin on staging or production environment one day, that would imply you have a nulled unlicensed plugin. I installed my original licensed WP Rocket on my local development […]
Category Archives: Performance
Bad session handling can lead to performance issues
The reason is shortly explained in the PHP documentation for session_start() function here: http://php.net/manual/en/function.session-start.php#110649 Furthermore, you can read about it in the session_write_close() function reference page. How we found this? We had slow loading of some admin pages (Plugins, All Pages) in WordPress and every time P3 Profiler was pointing to a different plugin, but […]
Monitoring slow queries in MySQL
If you are in doubt that some really slow queries are taking place on your server and they put you on too much load, then use this change in the configuration file to enable logging of slow queries: The config files usually is /etc/mysql/my.cnf. Uncomment these: slow-query-log = 1 slow-query-log-file = /var/log/mysql/mysql-slow.log long_query_time = 1 […]
Prevent hotlinking on your media files
Whenever you want to ban/prevent hotlinking your media files and protect your server’s resources and bandwidth you may use the following snippet in the .htaccess file of your main directory of your site.
1 2 3 4 5 6 7 8 |
# BEGIN Hotlinking Protection RewriteEngine On RewriteBase / RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?<strong>YOURSITE.YOURDOMAIN</strong> [NC] RewriteRule .(webm|3g2|3gp|3gpp|flv|m3a|m4a|m4b|mka|mkv|mov|mp2|mp3|mp4|mpeg|swf|wav|wma|wmv|<strong>XYZ</strong>)$ - [NC,F,L] # END Hotlinking Protection |
Just replace YOURSITE.YOURDOMAIN with your site and at the fourth row of the actual code (don’t mind the # comment line) […]
Cache meta tags in the header
1 2 3 |
<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" /> <meta http-equiv="Pragma" content="no-cache" /> <meta http-equiv="Expires" content="0" /> |
WordPress optimization like a boss
Hello, Scanning our logs on your account further, it seems that the majority of the usage is coming from your WordPress installation. We suggest that you optimize the software to run as efficiently as possible to use the least amount of resources. Since you are using WordPress, I suggest visiting these following URLs for more […]