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

using AWS Cloud Front as caching layer #15

Closed
Katafalkas opened this issue Jul 12, 2014 · 7 comments
Closed

using AWS Cloud Front as caching layer #15

Katafalkas opened this issue Jul 12, 2014 · 7 comments
Labels

Comments

@Katafalkas
Copy link

Any1 tried doing it ?

@agschwender
Copy link
Owner

Yeah, booted up a server and a cloudfront distribution real quick to confirm:

http://dghjy72o6k9e2.cloudfront.net/?url=http%3A%2F%2Fec2-54-191-135-3.us-west-2.compute.amazonaws.com%2Fstatic%2Flandscape.jpg&w=300
http://dghjy72o6k9e2.cloudfront.net/?url=http%3A%2F%2Fec2-54-191-135-3.us-west-2.compute.amazonaws.com%2Fstatic%2Flandscape.jpg&w=500

You need to turn on the flag that indicates query parameters should be passed to your server. If you don't mind, just let me know when you've taken a look so I can shut it down.

If you don't want to pass query parameters because you're concerned about caching performance, you can modify your web server to rewrite the urls to the query parameters that pilbox needs. For example,

/resize/crop/100x100/http%3A%2F%2Fexample.org%2Ffoo.jpg 

would be translated to

?op=resize&mode=crop&w=100&h=100&url=http%3A%2F%2Fexample.org%2Ffoo.jpg

Or whatever url format you think is appropriate.

@agschwender
Copy link
Owner

Just shutdown cloudfront and the ec2 instance I was using to test, so the links above will no longer work. But, yeah, you should have no problem using cloudfront.

@Katafalkas
Copy link
Author

Hey,

Cheers for reply. Sorry it took me so long to get back toy you. I am trying to do the same, but cant get it working. I get the:

ERROR

The request could not be satisfied.


Generated by cloudfront (CloudFront)

error.

As you mentioned above I have enabled the Forward Query Strings option.

@agschwender
Copy link
Owner

I assume you have some kind of webserver in front of pilbox. Are you seeing the cloudfront requests in your access logs?

@Katafalkas
Copy link
Author

Hey,

Yeah. I see no requests to NGINX and no tcp packets either using tcpdump dst port 80

@agschwender
Copy link
Owner

I suspect then that it's more a problem with how configured cloudfront to talk to your server or your server being unable to receive request, and less an issue with pilbox. That is, you should be seeing things in your access log regardless of the backend that you're using to serve your requests.

@Katafalkas
Copy link
Author

ok. figured it out. it was to do with infrastructure internals .. cheers for support !

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

No branches or pull requests

2 participants