T086ѧϰ�� | վ��ѧԺ | �����ĵ� | ���� | Ъ���� | IP��ַ��ѯ | �������� | ���ջ��� | �����ֵ� | ���ù��� | ������Ϣ��ѯ

���ֵ���web������Header�������ݹ��ڷ���

�� �������ߣ����� ����ʱ�䣺2008-11-06 | ���壺�� �� С��
[����]һ��Internet ��Ϣ���� (IIS)�����ݹ�����������IIS ��վ����ʱ��������Ϣ������������������֤������Ϣ���������������� Web ���������档����������վ���ݣ�ʹ֮���κε�ʱ���Զ����ڡ����������ݹ���ʱ��Web ����...

һ��Internet ��Ϣ���� (IIS)�����ݹ�������
����IIS ��վ����ʱ��������Ϣ������������������֤������Ϣ���������������� Web ���������档����������վ���ݣ�ʹ֮����
�ε�ʱ���Զ����ڡ����������ݹ���ʱ��Web ���������Ƚϵ�ǰ���ںͽ�ֹ���ڣ��Ա���������ʾ����ҳ���Ǵӷ������������µ�ҳ
��Microsoft ASP.NET �����ķ������˼��������ڶ�̬�����ṩ�����ݡ�ͨ����ʱ��������Ϣֻ���ڵ����ļ���Ŀ¼����վ����������Ҳ����Ϊij̨�������ϵ�������վ�������ݹ��ڡ�
�����DZ��ؼ������� Administrators ���ij�Ա���߱��뱻ί������Ӧ��Ȩ�ޣ�����ִ�����в��衣��Ϊ��ȫ�Ե����Ѳ�������ʹ�ò����� Administrators �����ʻ���¼��������Ȼ��ʹ�����з�ʽ�����Թ���Ա�������� IIS������
��������ʾ���£����� runas /user:administrative_accountname "mmc %systemroot%system32inetsrviis.msc"��
������վ���ݵĹ���ʱ��
1. �� IIS �������У�չ�����ؼ��������Ҽ�����Ҫ�������ݹ��ڵ���վ������Ŀ¼���ļ���Ȼ�󵥻������ԡ���
2. ������HTTP ͷ��ѡ���
3. ѡ�С��������ݹ��ڡ���ѡ����
4. �������������ڡ�������ʱ���κ����ڡ��򡰹���ʱ�䡱��Ȼ���ڶ�Ӧ�Ŀ������������Ĺ�����Ϣ��
5. ������ȷ������

����APACHE���������ݹ�������
Apache����ժ¼������
i. ������������
LoadModule headers_module modules/mod_headers.so
#Load �޸�header��ģ�顣
LoadModule expires_module modules/mod_expires.so
#Load �趨����header��ģ�顣
Header append Via: CCN-BJ-4-502
#����һ��Via header��ֵ���ó��豸��hostname��
KeepAliveTimeout 60
#�������ӵı���ʱ��Ϊ60�롣
ExpiresActive On
#���ù���header���ܡ�
ExpiresDefault A604800
#ȱʡ����ʱ��Ϊ�����ʺ���604800�롱

<Directory /data/download>
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
ExpiresByType text/html A300
#text/html�����ļ��Ĺ�������Ϊ�����ʺ���300�롱
ExpiresByType text/css A259200
#text/css�����ļ��Ĺ�������Ϊ�����ʺ���259200�롱
ExpiresByType application/x-javascript A300
# application/x-javascript�����ļ��Ĺ�������Ϊ�����ʺ���300�롱
ExpiresByType image/gif A2592000
#image/gif�����ļ��Ĺ�������Ϊ�����ʺ���2592000�롱
ExpiresByType application/x-shockwave-flash A2592000
# application/x-shockwave-flash�����ļ��Ĺ�������Ϊ�����ʺ���2592000�롱
</Directory>
���������ļ���load������ģ�飺mod_headers.so  ��mod_expires.so ������Apache���ж�header��һЩ���ƹ��ܡ�
ExpiresByType��     ��ʾ�����ļ����ͣ�MIME-TYPE�趨���ڲ��ԣ�
A300�� ��ʾ��Access��300�������ڣ�
ExpiresByType text/css A2592000��    ��ʾMime type��text/css���ļ�����Access��2592000�����ڡ�
ExpiresDefault A604800��  ��ʾ���˵����ƶ����ļ����͵ȹ��ڲ��������������ݣ���������ȱʡ�IJ����趨�����ʺ�604800�����ڡ�
 �����ķ�������ʵ�ָ���web�����IJ�ͬ�ļ����ͣ����Բ�ͬ�ķ���Ŀ¼���й��ڲ������á��ڰ������Ϸ������ú���Apache���Զ��IJ����������ص�http header���������£�
HTTP/1.1 200 OK
Date: Tue, 27 Mar 2007 17:44:21 GMT
Server: Apache/2.0.54 (Unix)
Last-Modified: Thu, 25 Jan 2007 07:45:45 GMT
ETag: ��72df3a-93-99499c40��
Accept-Ranges: bytes
Content-Length: 147
Cache-Control: max-age=2592000
Expires: Thu, 26 Apr 2007 17:44:21 GMT
Via: CCN-BJ-4-575
Keep-Alive: timeout=60, max=100
Connection: Keep-Alive
Content-Type: image/gif
Length: 147 [image/gif]
  ���У�Date �� Max-age = Expires.  Max-age�Ǹ�ʱ�䳤�ȣ���Ӧweb server�������õĹ���ʱ�䣻Expires�Ǹ���max-age�������Ĺ���ʱ���㣬������һ�µģ���ͬcache���ж������Ƿ�����ʱ���ϸ��Ƚ� ϵͳʱ������������ʱ�䣬���߱Ƚ�age����cache�д�ס��ʱ�䳤�ȣ���max-age��ֵ��

����lighttpd
lighttpdĬ����û�п���expireģ���ģ���Ҫ������ʹ�����ֹ���������ģ��֧�֡���mod_expireǰ���ġ�#����ȥ����
# vi  /usr/local/lighttpd/etc/lighttpd.conf
                                "mod_expire",
�趨����ʱ��
    * �趨ָ��url�Ĺ���ʱ�䣺
expire.url = (
       "/images/" => "access 3 hours",
       "/admin/" => "access 3 hours",
       "/area/" => "access 3 hours",
       "/calendar/" => "access 3 hours",
       "/common/" => "access 3 hours",
       "/front/" => "access 3 hours",
       "/inc/" => "access 3 hours",
       "/jeditor/" => "access 3 hours",
       "/js/" => "access 3 hours",
       "/script/" => "access 3 hours",
       "/theme/" => "access 3 hours",
       "/upload/" => "access 3 hours",
       "/view/" => "access 3 hours",
       "/help/" => "access 3 hours",
       "/htm/" => "access 5 minutes"
       )
����Etag
�������ļ������ӣ�etag.use-inode="disable"��i�ڵ㲻����etag�����㣩����֤��̨���������ɵ�Etagֵһ�¡�

 

  • ת����ע����Դ��ITѧϰ�� ��ַ��http://www.t086.com/ �����������Ƽ�������
  • �ر������� ��վ�������ر�������ֹת�ص�ר�������������¿�������ת�أ���������ע��������ԭʼ���ߡ����°�Ȩ������ԭʼ�������С����ڱ���վת�����µĸ��˺���վ�����DZ�ʾ������л�⡣������վת�ص������а�Ȩ��������ϵ���ǣ����ǻᾡ�����Ը�����
  • ��
  • ��
  • ��
  • ��
  • ��
  • ��
  • ��
  • ��
  • ��
������ѯ Health Check Gulangyu
© 2017 T086ѧϰ�� - T086.com(ԭitlearner.com)
RunTime:6.54ms QueryTime:7