PageSpeed : Clear or flush cache on web server
Have to migrate one of my website to a new server(droplet) recently when the original server was corrupted by broken sudo yum update
command.
The broken update caused the httpd
daemon to go crazy, consumed up all the CPU and caused the server to crash.
While the migration task is pretty easy and straightforward, but something was not right afterward. Some pages are static since the migration ended and restarting Apache's httpd did not help either. So what went wrong?
Apparently, the static pages are from the mod_pagespeed
's cache. To fix the problem, I have to flush the cache.
Go the to the cache folder
> cd /var/cache/mod_pagespeed
Remove everything inside
> rm -rf *
or if you prefer, you can just remove the files under certain folder or backup the files first before deleting them.
After this, do a restart for httpd
> sudo /etc/init.d/httpd restart
you will see some folders and files appear in /var/cache/mod_pagespeed
after httpd restarted.
Now, this method requires intervention by the system administrator(me) and if you are looking for automated solution. Please read up the official PageSpeed documentation on how flush the cache at https://developers.google.com/speed/pagespeed/module/system#flush_cache
Reference :
https://developers.google.com/speed/pagespeed/module/system#server_cache
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+12.6k Golang : Get terminal width and height example
+5.1k Golang : Reclaim memory occupied by make() example
+6.5k Golang : Humanize and Titleize functions
+14.3k Golang : How to get URL port?
+15.7k Golang : How to reverse elements order in map ?
+4.8k Golang : Check if a word is countable or not
+9.4k Random number generation with crypto/rand in Go
+7.2k Golang : How to handle file size larger than available memory panic issue
+16.1k Golang : Execute terminal command to remote machine example
+10.3k RPM : error: db3 error(-30974) from dbenv->failchk: DB_RUNRECOVERY: Fatal error, run database recovery
+23.6k Golang : Upload to S3 with official aws-sdk-go package
+35.8k Golang : How to split or chunking a file to smaller pieces?