人妻臀部不断上下耸动,欧美精品中文字幕亚洲专区,亚洲 欧美 自拍 另类 日韩 ,极品美女扒开粉嫩小泬

如何設(shè)置靜態(tài)內(nèi)容緩存時(shí)間

時(shí)間:2014-06-21 來源:天津文率科技有限公司

其實(shí)設(shè)置靜態(tài)內(nèi)容緩存時(shí)間就是讓網(wǎng)頁里的圖片還有js、css這些資源、包括頁面緩存到本地而不是每次都去服務(wù)器請求資源,這樣做可以減輕服務(wù)器的帶寬壓力和使網(wǎng)頁打開速度加快,這樣以來用戶體驗(yàn)就會(huì)好了一些,對seo是有好處的。

那么如何來設(shè)置緩存時(shí)間呢?下面我就以apache為例吧,因?yàn)槲覀兊?a href="http://www.lykskj.com/" target="_blank">官網(wǎng)用的是php+apache的,所以小韓就拿apache來說了

本文關(guān)鍵詞:gzip, cache-expire

用.htaccess設(shè)置網(wǎng)頁/圖片/js/css文件內(nèi)容緩存

開啟gzip的方法:

1、 http.conf下
將#去掉
LoadModule deflate_module modules/mod_deflate.so
添加如下設(shè)置:
<IfModule mod_deflate.c>
<Location />
#Insert filter
SetOutputFilter DEFLATE
# Netscape 4.x has some problems…
BrowserMatch ^Mozilla/4 gzip-only-text/html
# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip
# MSIE masquerades as Netscape, but it is fine
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# NOTE: Due to a bug in mod_setenvif up to Apache 2.0.59
# the above regex won’t work. You can use the following
# workaround to get the desired effect:
# BrowserMatch \bMSIE !no-gzip !gzip-only-text/html force-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

# Don’t compress images and other
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:pdf|doc)$ no-gzip dont-vary
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
AddOutputFilterByType DEFLATE application/x-javascript
# Make sure proxies don’t deliver the wrong content
Header append Vary User-Agent env=!dont-vary

#DeflateFilterNote ratio ratio_info
#LogFormat ‘”%v %h %l %u %t “%r” %>s %b “%{Referer}i” “%{User-Agent}i”” (%{ratio}n)’ deflate
#CustomLog logs/deflate_log deflate
</Location>
保存退出。重新啟動(dòng)apache就生效了

2 開啟cache-expire

第1步
LoadModule expires_module modules/mod_expires.so
LoadModule expires_module modules/mod_headers.so
在httpd.conf中,找到上面的代碼,然后將前面的#去掉

第2步
在httpd.conf中加入以下代碼,可以加到任何空白地方,不了解apache的朋友,如果擔(dān)心加錯(cuò)地方,就放到http.conf文件的最后一行

<IfModule mod_expires.c>

ExpiresActive On

ExpiresByType image/gif A2592000

ExpiresByType image/jpeg A2592000

ExpiresByType image/png A2592000

ExpiresByType image/x-icon A2592000

ExpiresByType application/x-javascript A604800

ExpiresByType text/css A604800

</IfModule>
如果apache無法啟動(dòng)了,檢查下是不是權(quán)限受了影響,因?yàn)槿绻L問權(quán)限設(shè)置的不對的話會(huì)報(bào)錯(cuò),具體可以查看apche的日志,然后百度去找問題根源了。

在開發(fā)過程中會(huì)有各種想不到的問題出現(xiàn),這時(shí)我建議大家多百度和谷歌一下。

好啦

不早啦,明天我們天津網(wǎng)站建設(shè)公司-文率科技來講講如何用壓縮js和css代碼。

更多網(wǎng)站建設(shè)方面的知識請關(guān)注我們的官網(wǎng) www.lykskj.com。


中国熟妇xxxx| 強姦犯された人妻たち| 日韩av人妻无码heyzo专区| 白嫩无码人妻丰满熟妇啪啪区百度 | 国产精品日本一区二区不卡视频| 日韩人妻无码中文字幕视频| 午夜精品久久久久久| 久久精品国产精品亚洲精品 | 大陆熟妇丰满多毛XXXX| 国内老熟妇对白hdxxxx| 国产欧美一区二区精品性色| 日韩精品无码熟人妻视频| 午夜成人理论无码电影在线播放| 国产小屁孩CAO大人| 亚洲熟妇无码av在线播放| 国产亚洲精品久久久久久| 少妇人妻av毛片在线看| 人妻少妇啊灬啊灬用力啊快| 色综合色狠狠天天综合色| 色综合AV综合无码综合网站| 亚洲综合小说另类图片久久 | 亚洲国产成人精品无码区99| 色婷婷香蕉在线一区二区| 一区二区三区| 中文字幕久精品免费视频| 房东天天吃我奶躁我| 亚洲一区二区三区av| 久久国产精品久久久久久| 好男人好资源影视在线| 久久aⅤ无码av高潮av喷吹| 精品无码av无码免费专区 | 99久久久无码国产精品不卡| 99久久大香伊蕉在人线国产| 久久无码专区国产精品s| 亚洲精品日韩一区二区电影| 大陆国产乱人伦| 国产乱人伦偷精品视频不卡| 久久久久无码精品亚洲日韩| 亚洲AV自慰白浆喷水网站少妇 | 爱我久久免费观看高清| 一本色道久久综合亚州精品蜜桃|