Lỗi <expiration not specified> tăng tốc cho hình ảnh, images, js , css

Thảo luận trong 'Thủ thuật phần mềm máy tính, điện thoại' bắt đầu bởi admin, 11/8/16.

  1. admin
    Tham gia ngày:
    22/5/13
    Bài viết:
    4,883
    Đã được thích:
    1,193
    Điểm thành tích:
    113
    Giới tính:
    Nam
    Hiển thị thông báo lỗi "expiration not specified" cho hình ảnh, images, javascript, css khi check tốc độ duyệt web tại trang
    Mã:
    developers.google.com/speed/pagespeed/insights
    Lỗi này xẩy ra phần lớn ở các website khi chưa định thời gian browser caching cho các tập tin này.
    leverage-browser-caching-expiration-not-specified.png
    Cách xử lý cho web Code PHP:
    • Chèn code dưới vào tập tin .htaccess của web.
    • Sau đó vào kiểm tra lại nhé.
    Mã:
    <IfModule mod_rewrite.c>
    
        ExpiresActive On
        ExpiresDefault "access plus 5 seconds"
        ExpiresByType image/x-icon "access plus 2592000 seconds"
        ExpiresByType image/jpeg "access plus 2592000 seconds"
        ExpiresByType image/png "access plus 2592000 seconds"
        ExpiresByType image/gif "access plus 2592000 seconds"
        ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
        ExpiresByType text/css "access plus 604800 seconds"
        ExpiresByType text/javascript "access plus 648000 seconds"
        ExpiresByType application/javascript "access plus 648000 seconds"
        ExpiresByType application/x-javascript "access plus 648000 seconds"
        ExpiresByType text/html "access plus 600 seconds"
        ExpiresByType application/xhtml+xml "access plus 600 seconds"
    
    </IfModule>
    
    Cách xử lý cho web Code ASP.NET:
    • Chèn code dưới vào tập tin web.config của web.
    • Sau đó vào kiểm tra lại nhé.
    Mã:
    <staticContent>
          <clientCache httpExpires="Sun, 29 Mar 2030 00:00:00 GMT" cacheControlMode="UseExpires" />
    </staticContent>
    
     
    Cảm ơn đã xem bài:

    Lỗi <expiration not specified> tăng tốc cho hình ảnh, images, js , css



Chủ để tương tự : Lỗi <expiration
Diễn đàn Tiêu đề Date
Thủ thuật phần mềm máy tính, điện thoại Sửa lỗi Linkedin: Your nocaptcha user response code is missing or invalid 17/9/23
Thủ thuật phần mềm máy tính, điện thoại Fix sửa cảnh bảo lỗi: base system device driver trong Device Manager windows 10 11 28/9/22
Thủ thuật phần mềm máy tính, điện thoại Lỗi: audio setup issue me device internal error Premiere Pro CC win 10 11 13/11/21
Thủ thuật phần mềm máy tính, điện thoại Lỗi tai nghe rút ra cắm lại không nghe được trên dell vostro 3/11/21
Thủ thuật phần mềm máy tính, điện thoại Sửa lỗi: Your device is missing important security and quality fixes win 10 23/12/20