Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.9.0

Request #5672 Enable Caching
Submitted: 2005-10-12 14:54 UTC Modified: 2005-10-18 11:49 UTC
From: sprice Assigned: ttsuruoka
Status: Closed Package: Services_Amazon
PHP Version: Irrelevant OS: Mac
Roadmaps: (Not assigned)    
Subscription  


 [2005-10-12 14:54 UTC] seth at pricepages dot org
Description: ------------ I'm interested in adding some sort of caching to the Services_Amazon package that you maintain on PEAR. My current thinking would be to add these methods: setCache($cacheType = "file", $cacheOptions = array()){} setCacheExpire($time){} And caching all requests in _sendRequest() except any operation regarding Carts or TransactionLookup.

Comments

 [2005-10-13 10:23 UTC] ttsuruoka at php dot net
Caching has been added. AmazonECS4.php (Services_Amazon-0.4.0) - http://p4life.jp/services_amazon/AmazonECS4.phps An example: - http://p4life.jp/services_amazon/cache.phps Dependency: PEAR::Cache_Lite I'm testing now. It works fine for me.
 [2005-10-13 11:01 UTC] seth at pricepages dot org
That works, but I was thinking of using Cache and not Cache_Lite so the DB cache could be used (and shared across a cluster if needed). Another advantage of Cache is that the agreement with Amazon is that if you cache prices for more than an hour you print a timestamp with the price on the page. Cache allows finer control over the expire time of data. For example: you don't cache prices for more than an hour, but you cache product info lookups for a week. The interface that I posted before allows the user to determine that. Also, I would make changes to not cache the SubscriptionId, AssociateTag, and Version because they shouldn't have any impact on the result array. I can make the changes and post what I'm thinking if you are interested. (I have some other small tweaks, also)
 [2005-10-13 12:53 UTC] ttsuruoka at php dot net
>I would make changes to not cache the SubscriptionId, >AssociateTag, and Version because they shouldn't have any >impact on the result array. I think that Version affects a result. >I can make the changes and post what I'm thinking if >you are interested. (I have some other small tweaks, also) Please post your feedback. Maybe I choose PEAR::Cache for more flexible cache control. Thanks for your comment.
 [2005-10-13 13:37 UTC] seth at pricepages dot org
 [2005-10-14 02:33 UTC] ttsuruoka at php dot net
 [2005-10-18 11:49 UTC] ttsuruoka at php dot net
This has been added in version 0.4.0.