• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[?] Deleting user created resources after user leaves site

In the app I'm currently working on, I use 'jpgraph' to create graphs. Works great - highly recommended.

In this particular application, users set up searches by varying criteria and graphs are created using that criteria. So there will be many different graph files created.

Problem: What's the best way to handle deleting images after a user is no longer on the site? Users do not create accounts on this site. Is it a matter of setting up a cron job to run at a particular time? Or is there a way to do this using sessions?



I run a cronjob at regular intervals that deletes all files older than x based on creation timestamp of the file.

Make sure your application can deal with file-not-found situations in case the user browses back or uses a bookmarked link with an expired graph.

Thanks, Wizard.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.