【发布时间】:2014-04-16 20:10:32
【问题描述】:
早上,
我对缓存网站没有几个问题,因为我之前没有尝试过缓存网站。 首先是如何缓存站点,以便在客户端浏览站点时加载速度更快。例如,我的 css 样式中有很多图像,如何缓存它?从我在 php 中缓存之前读到的内容是通过“head”标签完成的,并且缓存也可以在 .htaccess 中完成(很高兴我正在使用 htaccess ^_^)。
我在标题中添加了这个标签
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta http-equiv="expires" content="-1">
<meta http-equiv="pragma" content="no-cache">//or content="cache"???
这也是我的 htaccess 中的内容:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
先谢谢了,会经常光顾的,我真的很想学习如何缓存:)..
【问题讨论】:
标签: apache .htaccess codeigniter caching header