• apache gzip


    1、首先启动模块mod_deflate.so和mod_headers.so

    2、httpd.conf

    #文件缓存时间配置
    <FilesMatch ".(flv|gif|jpg|jpeg|png|ico|swf|js|css)$">
    Header set Cache-Control "max-age=2592000"
    </FilesMatch>
    #GZIP压缩模块配置
    <ifmodule mod_deflate>
    #启用对特定MIME类型内容的压缩
    SetOutputFilter DEFLATE
    SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png|exe|t?gz|zip|bz2|sit|rar|pdf|mov|avi|mp3|mp4|rm)$ no-gzip dont-vary #设置不对压缩的文件
    AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-httpd-php application/x-javascript #设置对压缩的文件
    </ifmodule>

    httpd-vhosts.conf

    <VirtualHost *:80>
    DocumentRoot "D:/mb/mb03"
    ServerName mb3.bridecool.com
    <Location "/">
    SetOutputFilter DEFLATE
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4.0[678] no-gzip
    BrowserMatch MSIE !no-gzip !gzip-only-text/html
    SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
    Header append Vary User-Agent env=!dont-vary
    </Location>
    </VirtualHost>

    //禁止目录访问

    <VirtualHost *:80>
    #禁止目录访问
    <Directory "D:/website/2syx.com/Uploads">
    Options -Indexes FollowSymLinks
    #修改为 -Indexes 即可
    </Directory>
    。。。。。
    </VirtualHost>

  • 相关阅读:
    Linear Predictors
    Non-Programmer's Tutorial for Python 3/File IO
    Python File I/O
    Introduction to Machine Learning
    Python3.6爬虫+Djiago2.0+Mysql --数据爬取
    MySql5.7 找回密码
    pyinstaller 打包python3.6文件成exe 运行
    python 连接mssql数据库
    Nopi 导出设置行高
    python登录aspx网站
  • 原文地址:https://www.cnblogs.com/lovezhaolei/p/4362761.html
Copyright © 2020-2023  润新知