Hi Chris,
Thank you for reading and for the compliment. I’m really glad that you enjoyed the article.
That is a very interesting idea on using caching instead of the database. My own personal preference is to use the database to keep track of everything and to ensure that all of the shortened URL’s are stored unless explicitly deleted, but there certainly are other ways to skin this particular cat.
I didn’t touch on caching in this article because I wanted to keep it brief and simple. There is plenty of room for improvement on my example, and adding some type of caching would be a good thing.
The script that inspired my project did employ some caching, so you might find it interesting. It can be found at http://briancray.com/posts/free-php-url-shortener-script. It has several features that I cut out the keep this example brief.
Thanks again for reading and for your feedback. I REALLY appreciate it.
Happy PHPing!
↧
By: Alex Fraundorf
↧