Can Swift serve up a 301/303 redirect?
Can I upload a redirect to Swift?
The problem I have is that I have a data store of a lot of files, many of which are identical. When a client requests a file, I would like to redirect that client to the canonical URL for that file (also stored in Swift). This allows clients to maximize their cache hit rate, and prevents them from storing multiple copies of the same thing in their cache.
As a quick example, I'd like to do something like: curl –X PUT -i \ -T JingleRocky.jpg \ https://storage.swiftdrive.com/v1/CF_xer7_343/dogs/JingleRocky.jpg (https://storage.swiftdrive.com/v1/CF_...) curl –X PUT -i \ -T /dev/null \ -H "X-Object-Meta-Redirect-303: https://storage.swiftdrive.com/v1/CF_xer7_343/dogs/JingleRocky.jpg%22 (https://storage.swiftdrive.com/v1/CF_...) \ https://storage.swiftdrive.com/v1/CF_xer7_343/dogs/dog1.jpg (https://storage.swiftdrive.com/v1/CF_...)
Then when I GET https://storage.swiftdrive.com/v1/CF_xer7_343/dogs/dog1.jpg (https://storage.swiftdrive.com/v1/CF_...) , Swift would return an HTTP 303 return code, with a redirect to https://storage.swiftdrive.com/v1/CF_xer7_343/dogs/JingleRocky.jpg (https://storage.swiftdrive.com/v1/CF_...) .
Is this possible? If not, how much work would you estimate this is to implement by an experienced python programmer? Would such a change be considered for inclusion into the main project?
Thank you, Tim