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

Setting Expires header for uploaded items #39

Closed
wilg opened this issue Jan 12, 2012 · 15 comments
Closed

Setting Expires header for uploaded items #39

wilg opened this issue Jan 12, 2012 · 15 comments

Comments

@wilg
Copy link

wilg commented Jan 12, 2012

The only issue I've seen with this gem is that it doesn't set an Expires HTTP header to the far-future when it uploads the assets to S3. This would be a great performance enhancement.

I may work on adding this myself, but I wanted to make sure that this was an appropriate addition.

@mattvanhorn
Copy link

I'd like this as well, and would be willing to work on it, too.

@davidjrice
Copy link
Contributor

Hey @mattvanhorn @supapuerco, you guys want to try out this branch I just put together? It includes two tweaks that should integrate Expires HTTP Header support and also adds cache control public.

Stick this in yer Gemfile.

gem 'asset_sync', :git => 'git://github.com/rumblelabs/asset_sync.git', :branch => 'cache-expiry'

@winfred
Copy link

winfred commented Jan 27, 2012

Sets the headers perfectly.

Thank you!

Looking forward to getting this merged in.

Btw, this gem is awesome.

@davidjrice
Copy link
Contributor

@wnadeau Cheers! Released Version 0.2.8 including these changes for you guys. Enjoy.

@Papipo
Copy link

Papipo commented Nov 10, 2012

Is it me or this doesn't work?

I didn't do anything special, I sync my assets to s3 on an application hosted on heroku, and my files don't have expires headers.

@ryanlindsey
Copy link

@Papipo Not just you, I'm noticing the same with a similar setup. I'm going to switch over to the other branch and test it out. I'll post back after...

@danmelnick
Copy link

Agreed — appears to not work for me either.

@jamienadeau
Copy link

Seeing the same thing on our app as well. Looks like Amazon must've changed something.

@Papipo
Copy link

Papipo commented Jan 18, 2013

@pixelsonly any news?

@ryanlindsey
Copy link

Sorry for the late response, things are working perfect now!


Response Headers

Accept-Ranges:bytes
Cache-Control:public, max-age=31557600
Content-Encoding:gzip
Content-Length:2210
Content-Type:application/javascript
Date:Sat, 19 Jan 2013 00:01:57 GMT
ETag:"c391a482ea363b343e033c32ac541685"
Expires:Sun, 19 Jan 2014 05:38:05 GMT
Last-Modified:Fri, 18 Jan 2013 23:38:06 GMT
Server:AmazonS3
x-amz-id-2:+zbtFloULvzkPusrbMRwjcaA+fMqbGhWFg0a6w2pR5Q6NvO4wuh4WtFAIW3naTFJ
x-amz-request-id:BCB69A93DED7E7B4

@Papipo
Copy link

Papipo commented Feb 27, 2013

It must have been a S3 problem. I haven't updated asset_sync but now the correct headers are there.

@kevinansfield
Copy link

Has this stopped working again? I'm not seeing any expires headers being set on my assets.

Would using a non-default S3 region affect anything?

@zerror
Copy link

zerror commented Aug 29, 2013

Expiration header not set for me either. Using default region with asset_sync. Any news on this?

@wpiekutowski
Copy link
Contributor

I've fixed this in my pull request: #223 . +1s are welcome

@synth
Copy link

synth commented Oct 24, 2013

+1

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

No branches or pull requests