hi!
I use the pattern.web module in a script. I use this script to search with search engines, retrieve urls and then download them (pattern.web.url.download).
Because there is the possibility that this script will do the same search engine query more than once, i would prefe to cache the results. It decreases the number of search engine hits and therefore it does charge less of my search engine account credits (for example google charges 5$ per 1000 hits).
In the web module says:
try:
# Import persistent Cache.
# If this module is used separately, a dict is used (i.e. for this Python session only).
from cache import Cache, cache, TMP
except:
cache = {}
So my cache is only stored in the memory. Every time I start the script again, the cache is empty. Is there a way to make the cache permanent and also control myself when to delete older cache entries?
cheerio!