dahlia / sqlalchemy-imageattach

SQLAlchemy extension for attaching images to entities.
https://sqlalchemy-imageattach.readthedocs.io/
MIT License
116 stars 25 forks source link

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

Open youknowone opened 9 years ago

youknowone commented 9 years ago

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:

dahlia commented 9 years ago

Does it purpose to invalidate client-side caching?

youknowone commented 9 years ago

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

dahlia commented 9 years ago

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

youknowone commented 9 years ago

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

dahlia commented 9 years ago

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?

youknowone commented 9 years ago

Fixed