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 8279379
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:19:07+00:00 2026-06-08T09:19:07+00:00

To speed up my website I have read about the Expires header, how to

  • 0

To speed up my website I have read about the Expires header, how to implement it in Apache, and how to only do so for certain file types. However I want to set a one month expiry on all files except .php files (webpages).

So how do I do this with .htaccess? I have a PHP script that uses filemtime to change the filename of CSS, JS files when they are edited, so that they are re-downloaded (eg if a file changes at xxxxxxx in Unix time, it changes the filename to /resource.css?recache=xxxxxxxx when it is requested). So that’s taken care of. As images etc. don’t change often, I want all of them to be cached for a month.

Also, what is the browser support for the Expires header?

  • 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-06-08T09:19:11+00:00Added an answer on June 8, 2026 at 9:19 am

    Use the mod_expires in your Apache configuration files. For example:

    # Turn on Expires and set default to 0
    ExpiresActive On
    ExpiresDefault A0
    
    # Set up caching on media files for 1 month
    <filesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|gif|jpg|jpeg|png|swf)$">
    ExpiresDefault A2592000
    Header append Cache-Control "public"
    </filesMatch>
    

    You can read more here

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

Sidebar

Related Questions

I want to speed up the load time of my website. I have studied
I discovered https://developers.google.com/speed/pagespeed/ the other day and have improved my website's page speed from
How to calculate approximately the connection speed of a website using JavaScript? I want
I've been working on a website lately and want to speed up my application.
My Clients are Complaining for slow speed of my osCommerce Website.. I dont have
I have a website and when I check page speed with Google plug-in, I
I've read about APC that it speeds up multiple php file sites. So I
I currently have a php file that must read hundreds of XML files, I
I have a few simple questions about data storage on a website I am
I have a HTML website running off Apache and using a MySQL database. I

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.