mardi 5 mai 2015

Bandwidth vs database querying

I display images that I want the user to be able to delete. I do this with an AJAX request.

Is it best practise to:

  1. Pass just the ID of the image, use mysql to find what the filename of that record is, and then delete the file?

OR

  1. Pass the ID and the src of the image so I can just delete the image right away without looking it up?

One uses more bandwidth, the other more processing power.

Either way I need the ID because I have to do delete the record.

Aucun commentaire:

Enregistrer un commentaire