How to manage query cache

SET GLOBAL query_cache_type = OFF;
SET GLOBAL query_cache_size = 0;
SET SESSION query_cache_type = OFF;

SHOW VARIABLES LIKE ‘query_cache%’;
SHOW VARIABLES LIKE ‘%query_cache%’;

#watch variables of cache status
SHOW STATUS LIKE ‘Qcache%’;

#clean cache
FLUSH QUERY CACHE;
FLUSH TABLES;