I am creating an RSS feed on-demand from a folder of images. The feed creation is pretty expensive on large sets of files obviously, so I am caching the feed after first creation but I’d like to know if I need to re-create the feed when someone calls for it.
I’m thinking that if I could figure out a way to cheaply create a unique hash of all the files and file dates, then when the hash changed I would know to re-generate the feed.
Does anyone have any ideas on how to cheaply create this hash? Is a hash even the right name for what I’m looking to do?
Edit:
I know a FileSystemWatcher exists exactly for this type of thing. But I’m more curious about an on-demand technique to do this. I’ve had other instances where I’ve done the same thing and used a file watcher to get the notifications but I figure someone has an idea of what to do when you can’t get file changed notifications…
you could select all the files in the folder ordered by modification date descending, then you only need to check the first files data against the last feed creation date and you’d know if you have to create the feed again.