• Need to Clear Cache all time

  • Tell error you get when using VPSSIM & Other members help fix it

Tell error you get when using VPSSIM & Other members help fix it
 #1249  by glauciolacerda
 26 Jul 2018 22:40
On some of my servers, especially those that get traffic from facebook ads, they stay out of the air while. When I see this happening, I need to go to VPSSIM and give it a Clear All Cache. After that, the sites return to normal functioning. Is there any way for the server to do this clear all automatic caching from time to time, or some plugin that I install and do this?
Get 25 USD Free To USE VPSSIM
 #1251  by nguyenoanh
 27 Jul 2018 08:08
Hello !
You can create a bash /home/clearcache.sh
Code: Select all
nano /home/clearcache.sh
Content:
Code: Select all
#!/bin/bash 
service nginx restart
service php-fpm restart
# ( echo "flushall" ) | redis-cli  #Clear Redis Cache / uncomment to use command
# echo "flush_all" | nc 127.0.0.1 11211 #Clear Memcached Cache / uncomment to use command
Save and make it can run
Code: Select all
chmod +x /home/clearcache.sh
And using Cronjob Manage in VPSSIM menu to add this to cronjob
Code: Select all
* */12 * * * root /home/clearcache.sh

=========================================================================
                VPSSIM - Manage VPS/Server by VPSSIM.COM
=========================================================================
                            Cronjob Manage
=========================================================================
                           Cronjob running: 1
=========================================================================
How to use: http://go.hostingaz.vn/howcronjob
=========================================================================

1) Add Cronjob			     4) Backup All Current Cronjobs
2) Delete Cronjob		     5) Restore Cronjob From Backup File
3) Clear All Cronjobs		     6) Cronjob running
Type in your choice (0-Exit): 1
=========================================================================
Example: To add Cronjob: * */5 * * * /root/backup.sh
-------------------------------------------------------------------------
You must type in: * */5 * * * /root/backup.sh
-------------------------------------------------------------------------
Type in Cronjob [ENTER]: * */12 * * * root /home/clearcache.sh
This cronjob run every 12 hours
 #1278  by glauciolacerda
 27 Jul 2018 20:04
[root@minhas_pbns_1 ~]# nano /home/clearcache.sh
[root@minhas_pbns_1 ~]# chmod +x nano /home/clearcache.sh
chmod: cannot access ‘nano’: No such file or directory
 #1288  by pauloficaadica
 28 Jul 2018 00:13
nguyenoanh wrote:
27 Jul 2018 08:08
Hello !
You can create a bash /home/clearcache.sh
Code: Select all
nano /home/clearcache.sh
Content:
Code: Select all
#!/bin/bash 
service nginx restart
service php-fpm restart
# ( echo "flushall" ) | redis-cli  #Clear Redis Cache / uncomment to use command
# echo "flush_all" | nc 127.0.0.1 11211 #Clear Memcached Cache / uncomment to use command
Save and make it can run
Code: Select all
chmod +x /home/clearcache.sh
And using Cronjob Manage in VPSSIM menu to add this to cronjob
Code: Select all
* */12 * * * root /home/clearcache.sh

=========================================================================
                VPSSIM - Manage VPS/Server by VPSSIM.COM
=========================================================================
                            Cronjob Manage
=========================================================================
                           Cronjob running: 1
=========================================================================
How to use: http://go.hostingaz.vn/howcronjob
=========================================================================

1) Add Cronjob			     4) Backup All Current Cronjobs
2) Delete Cronjob		     5) Restore Cronjob From Backup File
3) Clear All Cronjobs		     6) Cronjob running
Type in your choice (0-Exit): 1
=========================================================================
Example: To add Cronjob: * */5 * * * /root/backup.sh
-------------------------------------------------------------------------
You must type in: * */5 * * * /root/backup.sh
-------------------------------------------------------------------------
Type in Cronjob [ENTER]: * */12 * * * root /home/clearcache.sh
This cronjob run every 12 hours
Hey friend, I have had some problems like this, I didn't know it was because of the cache. :o :o :o :o

If this can happen with frequency, would it not be better for this setup the default cache cleanup to be available on a self create by the VPSSIM

Like as an extra option to schedule cleaning of the cache. And then just add the time in hours for this to be done.

It may be a great idea. :mrgreen:

Thank you!
 #1416  by datecom
 03 Aug 2018 11:31
Code: Select all
#!/bin/bash 
service nginx restart
service php-fpm restart
# ( echo "flushall" ) | redis-cli  #Clear Redis Cache / uncomment to use command
# echo "flush_all" | nc 127.0.0.1 11211 #Clear Memcached Cache / uncomment to use command
em muốn hỏi có nên restart 2 dịch vụ không bác Oánh? bởi em chỉ muốn xóa cache thôi, còn restart dịch vụ sẽ dẫn lỗi truy cập thời điểm kết nối đó
 #1417  by nguyenoanh
 03 Aug 2018 12:38
datecom wrote:
03 Aug 2018 11:31
Code: Select all
#!/bin/bash 
service nginx restart
service php-fpm restart
# ( echo "flushall" ) | redis-cli  #Clear Redis Cache / uncomment to use command
# echo "flush_all" | nc 127.0.0.1 11211 #Clear Memcached Cache / uncomment to use command
em muốn hỏi có nên restart 2 dịch vụ không bác Oánh? bởi em chỉ muốn xóa cache thôi, còn restart dịch vụ sẽ dẫn lỗi truy cập thời điểm kết nối đó
Bạn muốn xóa cache nginx và php thì để nguyên, không thì comment nó lại :)
Get 25 USD Free To USE VPSSIM