-
Notifications
You must be signed in to change notification settings - Fork 0
Description
It would be nice to have some sort of :passthrough => true option to Defog::Proxy.new(:provider => :local, ...) which would disable caching and proxying and directly serve up the actual files.
Rationale:
The current situation is that :local goes through the same caching mechanism as :AWS. This makes sense in particular for the common (i think) case that :local is being used in development as a standin for :AWS that is used production -- in this way development mimics the production behavior as closely as possible, and supports cache & synchronization manipulation.
But I've got a case where code that uses the Defog API to do some file processing on files stored in :AWS -- and it turns out in production i also want to occasionally do the same processing on files that originate on the client and aren't in AWS. Easy enough to do that by creating a Defog::Proxy using :local and it works fine -- except that it wastes time and space by making a proxy copy of each file and then synchronizing back. Would be nice to be able to skip proxying and act on the files directly.
Notes:
The :passthrough option would only make sense for :local. When enabled, things like :synchronize => false wouldn't make sense. (Ignore them? Warn? Error?) Also, without :passthrough, deleting the proxy file is equivalent to :synchronize => false, but if :passthrough were true deleting the "proxy" would really delete. This makes me think that without :passthrough, deleting a proxy file should instead either raise an error, or delete the remote file.