sqlalchemy-imageattach icon indicating copy to clipboard operation
sqlalchemy-imageattach copied to clipboard

Add unique_url options for store to create unique url even when image is changed

Open youknowone opened this issue 10 years ago • 6 comments

Getting unique path for image changing is useful, but missing feature (though it is able to be implemented in user side)

This patch includes breaking changes:

  • Any user customized store should add created_id argument to each put, get, delete methods
  • Any codes accessing to store url related api also should add created_id argument

youknowone avatar Jul 07 '15 06:07 youknowone

Does it purpose to invalidate client-side caching?

dahlia avatar Jul 09 '15 15:07 dahlia

Yes. It seems there are cases not able to invalidate them with query strings.

youknowone avatar Jul 11 '15 11:07 youknowone

Is the problem caused by query string, or impossibility to determine when exactly things are updated?

dahlia avatar Jul 11 '15 11:07 dahlia

Impossible to determine image is changed. The cache service is checking only the filenames.

youknowone avatar Jul 11 '15 11:07 youknowone

Okay. So there a trivial suggestion: passing an actual datetime value would be better than its encoded string representation, namely created_id. I think the better place of responsibility for how the created time has to be encoded is Store rather than Image. It gives more flexibility for supporting various store backends (for example, it can be used for providing Last-Modified header). What’s your opinion about this?

dahlia avatar Jul 11 '15 11:07 dahlia

Fixed

youknowone avatar Jul 16 '15 05:07 youknowone