To avoid repeated bandwidth usage, slow execution, or IP bans, you can cache queries in pandas-datareader by passing a requests_cache.Session object to the session parameter of the DataReader function. This is supported for maintained public data readers (e.g., fred).
When using a CachedSession with a sqlite backend, a file named cache.sqlite will be created in your working directory to store requests until they expire.
import pandas_datareader.data as web
import datetime
import requests_cache
# Define cache expiration (e.g., 3 days)
expire_after = datetime.timedelta(days=3)
# Initialize a CachedSession
session = requests_cache.CachedSession(cache_name='cache', backend='sqlite', expire_after=expire_after)
start = datetime.datetime(2010, 1, 1)
end = datetime.datetime(2013, 1, 27)
# Pass the session to DataReader
f = web.DataReader("VIXCLS", 'fred', start, end, session=session)
print(f.head())