[?] Deleting user created resources after user leaves site - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: [?] Deleting user created resources after user leaves site (/showthread.php?tid=40298) |
[?] Deleting user created resources after user leaves site - El Forum - 04-05-2011 [eluser]carvingCode[/eluser] 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? TIA Randy [?] Deleting user created resources after user leaves site - El Forum - 04-05-2011 [eluser]WanWizard[/eluser] 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. [?] Deleting user created resources after user leaves site - El Forum - 04-05-2011 [eluser]carvingCode[/eluser] Thanks, Wizard. |