forked from jeanphix/Ghost.py
-
Notifications
You must be signed in to change notification settings - Fork 10
Example Cache
carrerasrodrigo edited this page Mar 10, 2013
·
1 revision
Enabling cache it's one of the best ways to improve speed in our project, here it's an example that show us how to do it:
from ghost import Ghost # Here we create a ghost instance with cache in /tmp/ghost.py and a max size of 10 MB. # We also indicates that the cache folder would be shared between tabs gh = Ghost(cache_dir="/tmp/ghost.py", cache_size=10, share_cache=True) gpage, name = gh.create_page(download_images=True, prevent_download=["css"]) # Open google gpage.open("http://www.google.com")