Jump to content

Generate a unique filename for new photos/avatars


Feld0

Recommended Posts

Posted

Would it be possible to change how photo filenames are generated when a user uploads a new photo? This will allow those of us using a CDN to see photos update instantly when a user updates theirs.

I love that IP.Board makes it so easy to rewrite static URL's for use with a CDN, but many members are continuously pestering my staff and filling our "site problems" section with "Why do I not see my new photo?" questions as the CDN can take several days to re-cache a file (and the change may take even longer to flow down to users thanks to their browser caching it as well), when the fix to this would be as simple as ensuring that a new upload gets a new filename. Browsers and the CDN will then notice that it's a file they've never seen before and will be forced to download a fresh copy of it.

The current naming scheme uses "photo-<user ID>". As the filename is stored in the database as part of an account's data, changing the naming scheme for photos to, say... include a timestamp, could be done safely without breaking any existing photos. I can't imagine it would be too difficult to stick a timestamp or some random number into the photo's filename in the place where it is generated, but it's a change that my members and I would greatly appreciate. Every other forum package I've seen (including the free ones) has some way of ensuring that new avatars or photos get a new filename.

  • 2 weeks later...
Posted

Adding a unix timestamp to a filename would be as simple as using time(), and this one, simple change would make IP.Board users everywhere much happier.

One small tweak. Users would be happier. IPS customers would be happier. IPS would probably get more sales due to all of the sudden good feelings. It seems like it would be a win-win situation for everyone involved. Why not do it soon?

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...