The Definitive Guide to Yii 2.0
This tutorial is released under the Terms of Yii Documentation.
All Rights Reserved.
2014 (c) Yii Software LLC.
- Getting Started
- Application Structure
- Handling Requests
- Key Concepts
- Working with Databases
- Getting Data from Users
- Displaying Data
- RESTful Web Services
- Development Tools
- Special Topics
Besides server-side caching that we have described in the previous sections, Web applications may also exploit client-side caching to save the time for generating and transmitting the same page content.
To use client-side caching, you may configure [[yii\filters\HttpCache]] as a filter for controller actions whose rendering result may be cached on the client-side. [[yii\filters\HttpCache|HttpCache]] only works for
HEAD requests. It can handle three kinds of cache-related HTTP headers for these requests:
Page caching refers to caching the content of a whole page on the server-side. Later when the same page is requested again, its content will be served from the cache instead of regenerating it from scratch.
Page caching is supported by [[yii\filters\PageCache]], an action filter. It can be used like the following in a controller class:
Fragment caching refers to caching a fragment of a Web page. For example, if a page displays a summary of yearly sale in a table, you can store this table in cache to eliminate the time needed to generate this table for each request. Fragment caching is built on top of data caching.
The following code is a typical usage pattern of data caching, where
$cache refers to a cache component:
Caching is a cheap and effective way to improve the performance of a Web application. By storing relatively static data in cache and serving it from cache when requested, the application saves the time that would be required to generate the data from scratch every time.
Security best practices
Below we'll review common security principles and describe how to avoid threats when developing applications using Yii. Most of these principles are not unique to Yii alone but apply to website or software development in general, so you will also find links for further reading on the general ideas behind these.
Introduction Article Count: 2
Getting Started Article Count: 8
Application Structure Article Count: 12
Handling Requests Article Count: 8
Key Concepts Article Count: 9
Working with Databases Article Count: 8
Getting Data from Users Article Count: 6
Displaying Data Article Count: 7
Security Article Count: 7
Caching Article Count: 5
RESTful Web Services Article Count: 9
Development Tools Article Count: 3
Testing Article Count: 6
Special Topics Article Count: 12
Widgets Article Count: 2
Helpers Article Count: 4
Page 7 of 18