Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure duration_in_seconds - and hence max-age - has an integer value #79

Merged
merged 1 commit into from Dec 26, 2013
Merged

Ensure duration_in_seconds - and hence max-age - has an integer value #79

merged 1 commit into from Dec 26, 2013

Conversation

pvdb
Copy link
Contributor

@pvdb pvdb commented Nov 2, 2013

This is a small change to ensure that the max-age value in the Cache-Control header is an integer, not a float; this is especially relevant when setting the duration option for Rack::StaticCache to part of a year (instead of multiples of a year)

This requirement is covered by RFC 2616; from http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.6

Age values are non-negative decimal integers, representing time in seconds.

example - set duration to 1 week

use Rack::StaticCache,
  ...
  :duration => 1.fdiv(52)

before - max-age=606461.5384615385

$ curl -I http://localhost:5000/images/logo.png
HTTP/1.1 200 OK
Content-Type: image/png
Cache-Control: max-age=606461.5384615385, public
Expires: Sat, 09 Nov 2013 12:03:38 GMT
Content-Length: 18025

after - max-age=606461

curl -I http://localhost:5000/images/logo.png
HTTP/1.1 200 OK
Content-Type: image/png
Cache-Control: max-age=606461, public
Expires: Sat, 09 Nov 2013 12:27:33 GMT
Content-Length: 18025

@pvdb
Copy link
Contributor Author

pvdb commented Dec 25, 2013

Hey @rkh and @manveru - based on the project history over the last 12 months, it appears that the two of you are the most current owners of this project... quick question: is it still active, i.e. are you still accepting pull requests? if so, can you please have a look at this one? cheers, @pvdb

@prasanthsai
Copy link

Hi,

I'm not the owner of that repo.


G Prasanth
4th Year Undergraduate
Naval Architecture and Ocean Engineering
IIT Madras

On Thu, Dec 26, 2013 at 12:26 AM, Peter Vandenberk <notifications@github.com

wrote:

Hey @rkh https://github.com/rkh and @manveruhttps://github.com/manveru- based on the project history over the last 12 months, it appears that the
two of you are the most current owners of this project... quick question:
is it still active, i.e. are you still accepting pull requests? if so, can
you please have a look at this one? cheers, @pvdbhttps://github.com/pvdb


Reply to this email directly or view it on GitHubhttps://github.com//pull/79#issuecomment-31203685
.

manveru added a commit that referenced this pull request Dec 26, 2013
Ensure duration_in_seconds - and hence max-age - has an integer value
@manveru manveru merged commit 6ff3ca2 into rack:master Dec 26, 2013
@manveru
Copy link
Member

manveru commented Dec 26, 2013

Looks good to me.

@pvdb
Copy link
Contributor Author

pvdb commented Dec 26, 2013

Hey @manveru,

Looks good to me.

Thanks for looking into this, and for accepting the pull request!

@pvdb pvdb deleted the round_max_age_to_integer_value branch December 26, 2013 12:55
@pvdb
Copy link
Contributor Author

pvdb commented Dec 26, 2013

Hey @manveru - on a related note: it looks like the last time the gem was build and published to rubygems.org was more than 3 years ago... are there any plans to push a new version up?

@manveru
Copy link
Member

manveru commented Dec 26, 2013

That's not something I can do. The owners of the gem are @chneukirchen and @rtomayko

@pvdb
Copy link
Contributor Author

pvdb commented Dec 26, 2013

That's not something I can do.
The owners of the gem are @chneukirchen and @rtomayko

Of course... thanks for replying though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants