Open asiniy opened 8 years ago
I usually try to encourage users to use a HTTP cache, because that will skip exfile altogether. It might not hurt to have an extra layer of cache at this level, too.
It feels like a lot of reimplementing, though -- I have a similar mechanism in exfile-b2 to cache files. I think a general cache should either be implemented in exfile itself or in a separate hex package, what do you think?
I think there is no need to implement specific mechanism for every exfile
dependency, the main logic should be described in exfile
itself.
I like how does
exfile-imagemagick
works but it looks like it's not cache the results (even in the/tmp
), what can lead developers to the problems on highloads.In my opinion, ideal behaviour should be like that:
Exfile.Tempfile
based onid
,processor_name
&processor_args
should create a file in the/tmp
folder.In this case, if file is required to be rendered with some arguments too often, it'll be stored in the
/tmp
with name like/tmp/exfile/#{id}-#{processor_name}-#{processor_args}
and wouldn't be generated on every new request, because filesystem will look at it first. What do you think?