How to Set cache validity period in Apache
Today, I learned how to set cache time in Apache and remember it as a memo.
In the http header, the two fields related to the Cache time are Expires and max-age in Cache-Control. Expires sets a Cache
Yii set Cache
Add the following in the components array:?
1
'Cache' => array ('class' => 'cfilecache '),
Set Cache:?
12
Yii: app ()-> cache-> set ('testcache', array (,); // The default validity period is one year. Yii:
How to Set cache and obtain cache instances in js
Example: set and obtain cache in js.
// Set the cache, get the set cache, key-value pair form, name value
LocalStorage. getItem ("key"); // Obtain the key value
Oracle result set cache: oracle adjusts the result set cache with only three parameters. RESULT_CACHE_MAX_SIZE = 500 M/* Megabytes RESULT_CACHE_MAX_RESULT = 20/* Percentage limit = 3600/* Minutes, but all queries are saved only when
11G result set cache limit, 11G cache limitThere is a small table with a data volume of more than one million. This is similar to the IP address range lookup. The Table query volume is large. The data is generated in real time and sometimes
Take advantage of the Add () method in memcached. Memcached:add ($key) returns TRUE on success, or FALSE on failure. Returns False if this key already exists. Use the atomicity of add to determine whether business code needs to be executed. /** *
This article mainly and everybody introduced the PHP processing static page: the page sets the cache time instance, the small compilation thought quite good, now shares to everybody, also gives everybody to make a reference. Follow the small series
In the use of Linux host, the general use of the environment are apache+php+mysql to use, in fact, with your use of PHP, Mysql does not matter.
The key is Apache settings, generally as long as the httpd.conf set up. Htaccess can be used normally.
Effect: When you access a webpage within the specified time, the content on the webpage remains unchanged. When the time passes, the content on the webpage will access the server again to obtain data.
Front-end:
Background:
Protected void
I,Open IISManager
II,Select the website you want to set and click Properties to open the site properties menu.
III,Click HTTPHeader Tab
IV,ClickEnable content expiration
For example, set
My version is apache2.0.54. Add or modify it in httpd. conf.
Loadmodule cache_module modules/mod_cache.so
Loadmodule disk_cache_module modules/mod_disk_cache.so
Cacheroot D:/appserv/apache2/cacherootCachesize 256Cacheenable Disk/Cachedirlevels
In my cube memory disk, you only need to save the following content to the BAT file, copy the file to the folder you want to set as cache, and execute it with the administrator privilege. Win7.
BAT file content:
@ Echo offSet p0 = % appdata % \
First, the collection cache1. Do not use the collection cache:2. Use the collection cache:1) Configuration Hibernate.cfg.xml2) Test:
Second, supplemental level two cache, collection cache configuration
Third, query cacheList () is only cached by
Copy Code code as follows:
Rem XML Cache Class
'--------------------------------------------------------------------
' Please keep the copyright information when reprint
' Author: ╰⑥ Moon Rain
' Version: ver1.0
' This kind of part draws
Hibernate cache application accumulation and summary, and hibernate cache Accumulation
Hibernate cache has been relatively difficult to grasp, the following analysis and summary of the reasons, I believe you will gradually understand the original
Reduces server load. Apache enables the mod_expires module and apachemod_expires
Mod_expires can reduce repeated requests by about 10%, so that duplicate users CACHE the results of specified page requests locally and do not send requests to the
Mod_expires installation and configuration to increase website rateImplementing this method will save you incredible amounts of bandwidth and greatly speed up your site for visitors to your site. Basically, for images, CSS, JavaScript and other
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.