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

  • Home
  • SEARCH
  • 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 1114859
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T03:04:13+00:00 2026-05-17T03:04:13+00:00

What’s the difference between the following three .htaccess rules and when to use each,

  • 0

What’s the difference between the following three .htaccess rules and when to use each, is there any special use cases that prefers one over the other?:

Header set Cache-Control "max-age=290304000"
Header set Expires "Thu, 15 Apr 2020 20:00:00 GMT"
ExpiresDefault "access plus 10 years"
  • 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-17T03:04:13+00:00Added an answer on May 17, 2026 at 3:04 am

    Header is a directive of mod_headers that allows to modify HTTP header fields. In this case Header set effectively sets the mentioned header fields Cache-Control and Expires, so an already existing header field will be overwritten.

    The first directive sets the header field Cache-Control with the value max-age=290304000, that describes the freshness lifetime to be 290304000 seconds relative to the response time.

    In contrast to that, the second directive sets the header field Expires with the value Thu, 15 Apr 2020 20:00:00 GMT that describes the freshness lifetime with an absolute time value.

    Both Cache-Control’s max-age value and Expires expiration time stamp can be transformed to the other:

    4.2.1. Calculating Freshness Lifetime

    A cache can calculate the freshness lifetime (denoted as
    freshness_lifetime) of a response by using the first match of the
    following:

    • …

    • If the max-age response directive (Section 5.2.2.8) is present,
      use its value, or

    • If the Expires response header field (Section 5.3) is present, use
      its value minus the value of the Date response header field, or

    • …

    But if both are present, Cache-Control’s max-age is preferred over Expires:

    If a response includes a Cache-Control field with the max-age
    directive (Section 5.2.2.8), a recipient MUST ignore the Expires
    field. Likewise, if a response includes the s-maxage directive
    (Section 5.2.2.9), a shared cache recipient MUST ignore the Expires
    field. In both these cases, the value in Expires is only intended
    for recipients that have not yet implemented the Cache-Control field.

    Instead of setting these HTTP caching control header fields manually, mod_expires ExpiresDefault directive allows an easy setup for HTTP caching. The freshness lifetime can either be described with an absolute value or with a relative value, either relative to the response time (i.e. access/now) or relative to the modification time of the requested file (i.e. modification). It uses both Cache-Control and Expires.

    In this case the third directive sets the default freshness lifetime to be 10 years from the time of response on.

    I would use mod_expires for HTTP cache control instead of doing it manually with Header. It is far more convenient, allows both relative and absolute freshness times and uses both Cache-Control and Expires.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want use html5's new tag to play a wav file (currently only supported
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
this is what i have right now Drawing an RSS feed into the php,
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have just tried to save a simple *.rtf file with some websites and

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.