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

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

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

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

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

本文關(guān)鍵詞:gzipcache-expire

用.htaccess設(shè)置網(wǎng)頁(yè)/圖片/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無(wú)法啟動(dòng)了,檢查下是不是權(quán)限受了影響,因?yàn)槿绻L問(wèn)權(quán)限設(shè)置的不對(duì)的話會(huì)報(bào)錯(cuò),具體可以查看apche的日志,然后百度去找問(wèn)題根源了。

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

好啦

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

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


最近2018年中文字幕高清在线| 国产大人和孩做爰bd| 让少妇高潮无乱码高清在线观看| 日本在线观看哔哩哔哩视频| 亚洲综合av一区二区三区| 午夜欧美精品久久久久久久| 无码熟妇人妻AV在线影片免费| 色偷拍 自怕 亚洲 30p| 蜜臀精品无码AV在线播放| 国产av无码| 日本xxxx色视频在线观看| 亚洲乱亚洲乱妇50p| 国产精品久久久久久久久久免费| 国产手机精品一区| 国产精品色欲AV亚洲三区| 囯产精品久久久久久久久蜜桃| 无码日韩人妻AV一区二区三区| 少妇人妻好深太紧了a片 | zoz○zo女人和另类zoz0| 欧美一区二区三区成人片在线 | 自己在线观看免费高清| 51国产黑色丝袜高跟鞋| 欧美疯狂性受xxxxx喷水| 少妇性l交大片| 无码日本精品xxxxxxxxx| 国产免费av片无码永久免费| 含羞草亚洲AV无码久久精品| 人妻体验按摩调情BD| 又硬又粗又大一区二区三区视频| 西西444www无码大胆| 在线视频| 亚洲精品乱码久久久久久蜜桃不卡| 国产精品久久久久免费a∨| 国产性生交xxxxx无码| 久久99国产精品成人| 亚洲熟妇丰满xxxxx在线观看| 老师的粉嫩小又紧水又多a片| 两个女人互添下身视频在线观看| 久久久久免费毛a片免费| 四十路の五十路熟女豊満| 久久亚洲熟女cc98cm|