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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:23:06+00:00 2026-06-15T20:23:06+00:00

I have my ruby app setup on Heroku using the Sinatra framework. The web

  • 0

I have my ruby app setup on Heroku using the Sinatra framework. The web server is unicorn and when a request finds its content in the cache of memcached (via the Dalli gem), it says cache: [GET /] fresh so it’s clearly retrieving content from the cache. However when I check the headers, the response code is always a 200 instead of a 304. I was under the impression that when a page is served from cache as it’s still fresh the response code should be 304.

Is this working as intended and I’m misunderstanding something? Does Unicorn just not give 304 codes when it finds something in the cache? Should I just not worry about this sort of thing?

Any guidance is appreciated.

  • 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-15T20:23:07+00:00Added an answer on June 15, 2026 at 8:23 pm

    Unicorn cannot know how your application handles caching. Therefore it cannot set etags for you.

    Like Rajesh said, 304 is about browser cache.
    You will have to generate an Etag hash in your app and then send it to the browser (via header).

    According to this post browsers have support for etags : Browser support for eTags etags.

    Here is the official doc on 304 : http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5

    Edit :
    Take a look here to implement it with sinatra :

    http://www.sinatrarb.com/intro#Cache%20Control

    http://opensoul.org/blog/archives/2011/01/29/etags-with-memcached/

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

Sidebar

Related Questions

I have a ruby on rails app running a server and sometimes it needs
I have a Ruby on Rails app running on my server, and I can't
I have VPS with 1GB of RAM. One ruby-app that runs on thin server
Hey guys I have a ruby on rails app with a before filter setup
I have a simple model setup in my Ruby on Rails app. (User {name,
I have installed rubycas-server on my server. I have a ruby app that supports
I have an app that is using devise for authentication. Rails 3 on ruby
I have created a new rails app (3.2.8) using Devise. All is setup properly,
I have an Ubuntu 12.04 server setup that currently runs a Ruby on Rails
I have a Ruby on Rails app that I've recently deployed to a remote

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.