photo / openphoto-wordpress

A WordPress plugin for OpenPhoto
http://theopenphotoproject.org
22 stars 8 forks source link

Revisit requiring `generate=true` once redirects are enabled #11

Closed jmathai closed 12 years ago

jmathai commented 12 years ago

Issue openphoto/frontend#343 will make the URL to a created photo which was previously throwing a 500 error redirect to the static asset. This might alleviate the need to pass generated=true

randyhoyt commented 12 years ago

I wouldn't want the web address for the image that gets forever stored inside the publisher's web content to be the create web address, so the "generated=true" approach seems to work well enough.

I think the ideal scenario would be for the OpenPhoto API to return the web address where the image will be. If someone requests the image but it doesn't exist, then have OpenPhoto generate it as part of the 404. After that initial request and image creation, the image would exist for all subsequent requests. Is something like that possible?

jmathai commented 12 years ago

@randyhoyt That makes sense. I didn't realize it was stored in the db, generate=true definitely applies here.

WRT how the API handles it I believe the create URL is less "disruptive" than returning a 404. As a developer you're either interested in

  1. A URL that always renders to an image (static asset or a create URL).
  2. A URL that always references a static asset.

Randomly (from the dev/user perspective) giving a 404 seems hard to program around. The create URL + generate=true feels to be the best combination.