Amazon S3 (and probably many others) does not garantee how soon new content is available when you overwrite an existing file and access its URL.

As a result, we have experienced that when changing image style definitions or doing a custom cropping (using other modules), the newly generated images are not available immediately. This causes further issues since we flush our varnish cache, and the derived image URL may be called (and thereby cached) again before S3 serves the new content, resulting in a long time serving of old cached content.

This patch avoids the issue by always making an unique suffix to the file name of the file stored remotely, while keeping the local Drupal URI intact.

Comments

esbenvb’s picture

Here's a patch.

IMPORTANT: When porting the patch, remember to include the correct author information as mentioned here: http://drupal.org/user/989064

jbrown’s picture

Status: Needs review » Needs work

The way I have thought about fixing this is to have an extra column in the storage_instance table called "expires". When an instance is deleted this column would be populated and the record would not be removed until the expires time is reached.

This way the existing mechanism of finding a unique filename would not reuse the filename too soon.

perignon’s picture

Issue summary: View changes
Status: Needs work » Closed (won't fix)

Is this still an issue. At over 2 years ago it's rather old. If this is still valid please reopen. The Storage API is under a lot of rework at the moment so contributions are welcome!