Updating cakephp

05 Mar

If no new author has been added, Yii’s Cache component will take the Authors list directly from the cache, without executing again our big query, which could be something like:// big query $query = ' SELECT authors.*, book.title FROM authors JOIN book ON = authors.book_id'; // dependency query $dependency = new CDb Cache Dependency('SELECT MAX(id) FROM authors'); // executing query using Yii Query Builder $result = Yii::app()-As explained before, when running this code, Yii will check for the result of the dependency query before anything else.

Should it not find anything, or a different value from the one stored before, it will execute the big query and store the result in cache.

Other frameworks suffer from the performance hit because they would enable a functionality (e.g.

DB connection, user session) no matter it is used or not during a request.

The reason for doing that is to check if anything has changed since the last time that we executed that query.

By doing so, we will be able to see if any new author has been added since the last time we checked.

Should the value not be found (because it does not exist or because it did expire before), this function will return a false value.lib/ models/ Contact Search runtime/ views/ layouts/ site/ www/ assets/ css/ js/ * yiic What is the first file that gets loaded when you run a application using Yii?= Models represent the underlying data structure of a Web application.Yii is so much faster because it is using the lazy loading technique extensively.For example, it does not include a class file until the class is used for the first time; and it does not create an object until the object is accessed for the first time.