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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:21:59+00:00 2026-06-06T19:21:59+00:00

I have set cache headers to be far in future (1 year from now)

  • 0

I have set cache headers to be far in future (1 year from now) and have disabled the ETags as advised by the YSlow (http://developer.yahoo.com/performance/rules.html#etags) but Google pagespeed seems to require ETag (or last-modified) even after the cached headers are set.

“It is important to specify one of Expires or Cache-Control max-age, and one of Last-Modified or ETag, for all cacheable resources.”

The two rules seems to be conflicting each other.

  • 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-06T19:21:59+00:00Added an answer on June 6, 2026 at 7:21 pm

    YSlow does not advise to remove ETags in general but for some environments. When not using ETags then you should use Last-Modified instead.

    ETag and Last-Modified are for conditional GET-Requests when re-requesting an already cached and maybe expired resource.

    Cache-Control max-age is for defining how long a cached item is valid for sure without asking again. (When expired by this rule then the browser will make a conditional GET …)

    So in your case:

    • Browser is caching the resource for one year. Within that year no request for this resource is done at all. It’s directly served from local cache. (uses Cache-Control header settings.)
    • Browser does conditional Request after one year expired to check if something changed. The server responds with HTTP 304 and empty body when nothing changed. The browser continues to use its cached item in that case without the need of retransmission. (uses ETag and/or Last-Modified header settings)

    (The browser may or may not respect your data. For example it is possible that a browser will do a conditional request even when one year has not been expired yet.)

    For highly optimized sites the Cache-Control is far more important, because you set it faaaar future expire headers and simply change the URL for the resource in case it changed. While this prevents the use of conditional Requests it gives you the ability to be extremly aggressive when defining the expires header while being able to serve new versions of the resource immediatly to everybody at the same time. This is because of the new URL it seems to be a new resource in browser’s view.

    For Java there exists a framework called jawr which makes use of these and other concepts without having negative impact to your site development.

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

Sidebar

Related Questions

I have my cache related headers set to expire at eight hours as follows...
I have found the following page on the matter: http://typo3.org/development/articles/using-cache-control-headers-in-typo3/page/3/ But enabling config.sendCacheHeaders does
I am trying to set up caching correctly and have set Expires headers to
How can I set Http headers in the result object in play 2.0? I
In my .htaccess file I have: <FilesMatch \.(js|css|png|gif|jpg)$> <IfModule mod_headers.c> Header set Cache-Control public,
I have two questions. Question #1: What is the difference between HttpWebResponse.Cookies and WebResponse.Headers[Set-Cookie]?
Trying to set cache response headers on a dynamically-generated image, I'm getting a weird
In IIS7 I am trying to set a really far future expires header for
I want to set Cache-Control headers on my static assets (all my UI images)
I have set the eclipse java formatter to wrap lines that exceed 120 characters

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.