Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 285021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:30:32+00:00 2026-05-12T05:30:32+00:00

Today I have checked performance statistics of my website using YSlow . I got

  • 0

Today I have checked performance statistics of my website using YSlow. I got a warning (or error may be) which is as below

Add Expires headers
There are 15 static components without a far-future expiration date.

    * (no expires) http://www.example.com/video/css/global.css
    * (no expires) http://www.example.com/video/js/global.js
    * (no expires) http://www.example.com/video/images/main-bg.png

What this means and how to achieve this in PHP and ASP.NET both. I am on shared hosting server, so please tell me some way to do this using code, because I’ll not able to make any modification at the server end.

If I’ll expire the header then is there any chance that if I’ll make changes in the CSS then user will not get them right away because css and other files are cached for a certain time limit (1 month, week). Is it?

Is there any disadvantages of using expire headers??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T05:30:32+00:00Added an answer on May 12, 2026 at 5:30 am

    PHP

    $time = time() + 3 * 24 * 60 * 60; // 3 days
    header('expires: ' . gmdate('D, d M Y H:i:s \G\M\T', $time);
    

    But I would recommend you the Apache module mod_expires [1]. You can then put something like this in an .htaccess file

    <FilesMatch "\.(jpg|gif|png|css|js)$">
        ExpiresActive on
        ExpiresDefault "access plus 3 days"
    </FilesMatch>
    

    This will match all Images, CSS and JavaScript files and set an Expires header for 3 days

    [1] http://httpd.apache.org/docs/2.0/mod/mod_expires.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been using Hibernate very successfully, but today I noticed a bizarre phenomenon
I'm using SQL Server (2005). Today I have some tables that everytime the data
I have an XBAP on my website that used to work. I checked it
Today I was using Git and something happened to me which I didn't know
I've run on a little problem today: I have a JS drop down menu
Today my colleagues and me have a discussion about the usage of the final
Today, I have seen some legacy code. In the destructor there is a statement
I learned today that NetBeans 6.5 should have an on-the-fly compilation of (single) Java
Today I discovered something that makes me sad: objects of type System.Generic.Collections.List don't have
I have just started playing with the ASP.Net MVC framework, and today I created

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.