Welcome Guest, Not a member yet? Register   Sign In
Query Caching or NOT?!!!
#6

(This post was last modified: 06-26-2017, 12:52 PM by spjonez.)

Client side templating using pre-compiled and gzipped views so your browser can cache them like CSS and JS files. Render them using live data. Run explain on all your queries and add appropriate indices.

For queries that are unlikely to change during a request use static caching like ivantcholakov says;

Code:
    public function get_countries( ) {
        static $results;

        if ( $results == null ) {
            $results = $this->db->query( "SELECT c.* FROM country c WHERE c.archive = 0 ORDER BY c.name ASC" )->result_array( );
        }

        return $results;
    }
Reply


Messages In This Thread
Query Caching or NOT?!!! - by pb.sajjad - 06-21-2017, 06:13 AM
RE: Query Caching or NOT?!!! - by rtenny - 06-23-2017, 08:01 AM
RE: Query Caching or NOT?!!! - by natanfelles - 06-23-2017, 08:13 AM
RE: Query Caching or NOT?!!! - by kilishan - 06-23-2017, 09:15 AM
RE: Query Caching or NOT?!!! - by ivantcholakov - 06-24-2017, 11:07 AM
RE: Query Caching or NOT?!!! - by spjonez - 06-26-2017, 12:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB