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

Cache processing results #51

Open
asiniy opened this issue Nov 19, 2016 · 3 comments
Open

Cache processing results #51

asiniy opened this issue Nov 19, 2016 · 3 comments

Comments

@asiniy
Copy link
Contributor

asiniy commented Nov 19, 2016

Now all processed files (especially images) are generated on each query.

It's not difficult if you have only couple of images to be rendered on the page. But this becomes a problem when you have a webpage which requires 20-30 images to be generated simultaneously. They are returned one after another, even on powerful VPN.

In my opinion, exfile should have a cache ability, like:

config :exfile, Exfile,
  cache: %{
    size: '10GB',
    path: '/tmp/exfile-other' # default is `/tmp/exfile-cache-#{env}`
  }

All processed images will be stored to path and will have the mark of their earlier usage assigned, and there also will be a supervisor which monitors size of the path folder. If it oversizes limit, it will destroy the oldest unused images in it.

@keichan34 WDYT?

@keichan34
Copy link
Owner

Sorry about the late reply on this.

Since files are fingerprinted and processing inputs are in the URL, the requests can be cached by a normal HTTP cache (nginx and/or any pull-based CDN like CloudFront, CloudFlare, Fastly, etc). I don't think it's in the scope of Exfile to cache outputs when a HTTP cache can do it equally as well.

@asiniy
Copy link
Contributor Author

asiniy commented Feb 26, 2017

@keichan34 interesting idea! Let me test it, I'll response in ~ 1 week

@scarfacedeb
Copy link
Contributor

@asiniy you could also put nginx in front of elixir app and cache exfile responses with it.

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

3 participants