bbenezech/papermill

Thumb regeneration every time the page is requested

Closed this issue · 4 comments

Hi,
in a production server, when I call:
product.pics[0].url("938x340#")

the resizing process is performed every time the page is requested and the gem doesn't use the already cached file in:
/public/system/papermill/000/000/015/938x340#/xxxx.jpg

This implies a waste of cpu resourses and it slow the page rendering.
Do I miss any configuration statement?
Thanks for the kindly reply.
Best Regards,
Mick

Hello,

If the resource is on the hard-drive (and it must if you see the file, because you are redirected to it when the generation is done), then the pb can only come from an Apache/Nginx/etc. configuration issue. Requests to assets found on the /public filesystem must be served with Apache, not your Rails stack. Check your Apache configuration or explain your problem to the relevant newsgroup, it shouldn't be an issue for long.

Best Regards,

Ben

Ok, resolved.
Setting an alias on the papermill initializer file fix the problem.

Thanks a lot,
Mick

Maybe means that your webserver cut the URL at the '#', can't find the /public/system/papermill/000/000/015/938x340 resource, and forwards to rails the full demand : /public/system/papermill/000/000/015/938x340#/xxxx.jpg
Never had this problem.
What are you using for hosting, out of curiosity ?

I think, as you already wrote, the problem is the '#' char.
My hosting is a normal linux centos, with apache 2.x, passenger, ruby 1.8.7 and rails.
Nothing strange, dont' u?