Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
W Wiki
  • Project overview
    • Project overview
    • Details
    • Activity
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Members
    • Members
  • Activity
Collapse sidebar
  • Tutoriais
  • Wiki
  • Wiki
    • Servidores
  • Redis

Last edited by Jonatan Machado Mar 27, 2019
Page history

Redis

Adicionei uma nova funçao para limpar o cache cada vez que roda essas funçoes do w3 total cache iso pode ser adicionado em qualquer site que usa wordpres com o redis + w3 total cache

Pode ser adicionado no functions.php de qualquer tema que use o plugin "W3 Total Cache"

function check_plugin_w3tc_state(){
    if (is_plugin_active('w3-total-cache/w3-total-cache.php')){
			//Limpa todo o cache do redis qundo faz algumas dessas açoes 'save, delete, trash'
			add_action( 'save_post', 'flush_redis_save_post' );
			add_action( 'delete_post', 'flush_redis_save_post' );
			add_action( 'trash_post', 'flush_redis_save_post' );
			add_action( 'wp_trash_post', 'flush_redis_save_post' );
			function flush_redis_save_post()
			{
				w3tc_flush_all();
			}
   }
}
add_action('admin_init', 'check_plugin_w3tc_state');

Limpar o cache do redis via terminal

[ceicom@server]$ redis-cli

127.0.0.1:0000> FLUSHDB

127.0.0.1:0000> FLUSHALL

127.0.0.1:0000> exit

Clone repository
  • Gitlab
    • Comandos
  • Hotfix
    • og:image
  • Magento
    • Htaccess
    • MagentoCronChecker
    • Robots
    • SimpleSchema
    • Soap v2 Tester
    • gitignore
  • Migração
    • leg.br
  • Padrões
    • eslint
    • prettier
  • Plugins
    • Adicionar informações extras ao texto copiado da web
  • QueryCommerce
  • Servidores
    • Cloudways
    • DnsMadeEasy
View All Pages