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

The Archive Base Latest Questions

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

Starting with no cache on server or client FIRST REQUEST GET /post/1 HTTP/1.1 HTTP/1.1

  • 0

Starting with no cache on server or client

FIRST REQUEST

GET /post/1 HTTP/1.1

HTTP/1.1 200 OK
Date: Fri, 05 Mar 2010 09:05:46 GMT
Last-Modified: Thu, 04 Mar 2010 21:00:08 GMT
X-Rack-Cache: miss
Etag: "c226165d5817af7c91592dab0bc0ac63"
Cache-Control: max-age=3600, public

The Cache is missed and Rails gets hit and queries the database:

if stale?(:etag => @document, :last_modified => @document.updated_at.utc) # => true
  expires_in 1.hour, :public => true
  @post = Post.find(params[:id])
end

SECOND REQUEST

GET /post/1 HTTP/1.1
If-Modified-Since: Thu, 04 Mar 2010 21:00:08 GMT
If-None-Match: "c226165d5817af7c91592dab0bc0ac63"
Cache-Control: max-age=0

HTTP/1.1 304 Not Modified
Date: Fri, 05 Mar 2010 09:10:04 GMT
X-Rack-Cache: miss
Etag: "c226165d5817af7c91592dab0bc0ac63"
Cache-Control: max-age=3600, public

The Cache is missed and Rails gets hit, but this time it sends 304 Not Modified and the database is not hit:

if stale?(:etag => @document, :last_modified => @document.updated_at.utc) # => false
  expires_in 1.hour, :public => true
  @post = Post.find(params[:id])
end

However I was under the impression this should hit the Cache since the etag matches (If-None-Match/Etag)?

  • 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-13T23:08:17+00:00Added an answer on May 13, 2026 at 11:08 pm

    I’m doing a full refresh (F5) so the browser is adding Cache-Control: max-age=0 which is preventing the cache thinking the page is fresh.

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

Sidebar

Ask A Question

Stats

  • Questions 495k
  • Answers 495k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer This article shows how to do exactly that for a… May 16, 2026 at 11:26 am
  • Editorial Team
    Editorial Team added an answer If you're getting that error, you're building for the device,… May 16, 2026 at 11:26 am
  • Editorial Team
    Editorial Team added an answer It might help to start by writing out the type… May 16, 2026 at 11:26 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have an established Magento site that is only just starting to get complaints
I am starting a project from scratch using Intersystems Cache. I would like to
I have a webpage that makes an ajax call to get some data. That
I'm coming from the LAMP world, where the cache everything mentality is prevalent. Everything
Starting with MVC2, messing around with a simple db and just using the index
After starting out with Python on Ubuntu Linux, I've now for a good while
Just starting out with jQuery and this problem seems to be impossible to me.
Just starting with ASP.NET and find it difficult to use the GridView. I have
I am just starting with f# so the question may seem easy for some
I'm starting to play around with MVC. I did the NerdDinner walkthrough and now

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.