: This article mainly introduces the js and css cache classes based on Redis. For more information about PHP tutorials, see.
Redis = new Redis (); $ this-> redis-> connect (REDIS_HOST, REDIS_PORT);} public function init ($ array = []) {if ($ this-> redis-> get ('updated') = 1) return; foreach ($ array as $ k => $ v) {if ($ v [0] = 'js') $ this-> redis-> set ($ k, 'script '. file_get_contents ($ v [1]). 'script '); if ($ v [0] = 'css') $ this-> redis-> set ($ k ,'') ;}$ This-> redis-> set ('updated', 1 );} public function get ($ c {echo $ this-> redis-> get ('jquery ') ;}}$ setup = ['jquery' => ['js ', 'http: // response> ['css ', 'http: // cdn.amazeui.org/amazeui/2.4.2/css/amazeui.css'], 'angular' => ['js', 'http: // rewrite im (); $ k-> init ($ setup); $ k-> get ('jquery ');
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.
The above introduces the js and css cache classes based on Redis, including some content. I hope my friends who are interested in PHP tutorials can help me.