Hãy đăng ký thành viên để có thể dễ dàng trao đổi, giao lưu và chia sẻ về kiến thức đồ họa.
  1. Hãy đăng ký subscribe kênh Youtube mới của Việt Designer tại địa chỉ: Youtube.com/VietDesignerChannel để theo dõi các video về thiết kế đồ họa. Do trước đó kênh cũ bị Youtube quét không rõ lý do, trong thời gian chờ kháng cáo nếu các bạn thấy video trên diễn đàn bị die không xem được thì có thể vào kênh mới để tìm xem video sơ cua nhé.
    Loại bỏ thông báo

Cần giúp về Gzip trên hostinger.vn

Chủ đề thuộc danh mục 'Hỏi đáp - Thảo luận về web' được đăng bởi hoagao, 24/12/16.

Lượt xem: 2,922

  1. hoagao Thành viên cấp 2

    Mình có tạo trang web và đăng lên hostinger.vn nhưng mình không biết cách Gzip để tối ưu tốc độ của website.bạn nào biết chỉ mình với.
    chân thành cảm ơn.

    Y4kf5MV.png

    mình kiểm tra trên https://www.webpagetest.org thì nó vẩn hiên phần:
    • Compress Transfer
    • Cache static content
    • có điểm tối ưu rất thấp
    bạn nào biết chỉ mình với.
    xin cảm ơn rất nhiều ạ

    ...
  2. quangpro1610

    quangpro1610 Thành viên cấp 2

    Thử tìm hiểu cách Gzip với .htaccess đi bạn.
    hoagao thích bài viết này
  3. hoagao

    hoagao Thành viên cấp 2

    cảm ơn bạn.mình có chèn 1 vào dòng vào file .htaccess nhưng vần vậy bạn
    "
    Options -Indexes
    # START PHPfox Rewrite
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^static/ajax.php index.php
    RewriteRule ^themes/default/(.*) PF.Base/theme/default/$1
    RewriteRule ^(file|static|theme|module)/(.*) PF.Base/$1/$2
    RewriteRule ^(Apps|themes)/(.*) PF.Site/$1/$2


    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d

    RewriteRule ^(.*) index.php/$1
    </IfModule>
    # END PHPfox Rewrite
    # Modify Headers
    <IfModule mod_headers.c>
    # Cache files
    <FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$">
    Header set Cache-Control "public"
    Header set Expires "Mon, 20 Apr 2015 20:00:00 GMT"
    Header unset Last-Modified
    </FilesMatch>

    # Cache JavaScript & CSS
    <FilesMatch "\.(js|css)$">
    Header set Cache-Control "public"
    Header set Expires "Mon, 20 Apr 2015 20:00:00 GMT"
    Header unset Last-Modified
    </FilesMatch>
    </IfModule>
    # Compress JavaScript & CSS
    <IfModule mod_deflate.c>
    <FilesMatch "\.(js|css)$">
    SetOutputFilter DEFLATE
    </FilesMatch>
    </IfModule>
    <ifModule mod_gzip.c>
    mod_gzip_on Yes
    mod_gzip_dechunk Yes
    mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
    mod_gzip_item_include handler ^cgi-script$
    mod_gzip_item_include mime ^text/.*
    mod_gzip_item_include mime ^application/x-javascript.*
    mod_gzip_item_exclude mime ^image/.*
    mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
    </ifModule>
    <ifModule mod_expires.c>
    ExpiresActive On
    ExpiresDefault "access plus 3600 seconds"
    ExpiresByType text/html "access plus 3600 seconds"
    ExpiresByType image/gif "access plus 2592000 seconds"
    ExpiresByType image/jpeg "access plus 2592000 seconds"
    ExpiresByType image/png "access plus 2592000 seconds"
    ExpiresByType text/css "access plus 604800 seconds"
    ExpiresByType text/javascript "access plus 216000 seconds"
    ExpiresByType application/x-javascript "access plus 216000 seconds"
    </ifModule>

    <ifModule mod_headers.c>
    <filesMatch "\\.(ico|pdf|flv|jpg|jpeg|png|gif|swf)$">
    Header set Cache-Control "max-age=2592000, public"
    </filesMatch>
    <filesMatch "\\.(css)$">
    Header set Cache-Control "max-age=604800, public"
    </filesMatch>
    <filesMatch "\\.(js)$">
    Header set Cache-Control "max-age=216000, private"
    </filesMatch>
    <filesMatch "\\.(xml|txt)$">
    Header set Cache-Control "max-age=216000, public, must-revalidate"
    </filesMatch>
    <filesMatch "\\.(html|htm|php)$">
    Header set Cache-Control "max-age=1, private, must-revalidate"
    </filesMatch>
    </ifModule>
    <ifModule mod_headers.c>
    Header unset ETag
    </ifModule>
    FileETag None
  4. quangpro1610

    quangpro1610 Thành viên cấp 2

    Bạn thử xem ở đây coi có cách nào dùng được ko? :D
    hoagao thích bài viết này
  5. hoagao

    hoagao Thành viên cấp 2

    cảm ơn bạn quangpro1610 nhưng mình vẩn chưa sửa được bạn ạ.mình cũng làm theo nhưng cũng không được. có điều mình tạo một hosting trên trang 000webhostapp.com thì nó lại tự GZip nhưng điểm
    • Cache static content
    lại là F
    LnQjBPO.png

    mấy cái này mình hòn toàn không biết tối ưu thế nào luôn.
  6. hoagao

    hoagao Thành viên cấp 2

    có bạn nào biết làm thế nào để
    • Cache static content
    có điểm A không ạ.giúp mình với.
  7. HenryBuiVu

    HenryBuiVu Mới đăng kí

    bạn vào mục "cấu hình php" bật nén lên là xong, đỡ phải cài.
    hoagao thích bài viết này

Ủng hộ diễn đàn