nbviewer
nbviewer copied to clipboard
How long does a cached notebook persist?
I stumbled onto issue #219 on accident by having a loose <div> that totally shredded page layout. I quickly corrected it in my Gist, but the NBViewer seems to have cached the busted version and won't forget. Granted, I'm a bit impatient, but I sent out a link to the notebook to some collaborators and figure they might look at it in short order. A better developer would probably check their code before pushing it out...
Anyways, perhaps add another question (and answer) to the FAQ: Why isn't my notebook updating?
normally, it will be cached for ten minutes, but it will be longer if it takes a long time to render.
Is there a way to force NBViewer to update its cached render?
For me ?flush_cache=true shows the new variant, but when I remove it I still have the old version.
For me ?flush_cache=true shows the new variant, but when I remove it I still have the old version.
Having this issue too.
In my experience, it almost seems like ?flush_cache=false is necessary to actually flush the cache, and that ?flush_cache=true does the opposite (not flush the cache).
E.g. see here: https://github.com/krinsman/clonenotebooks/blob/master/templates/notebook.html#L33
In this extension to NBViewer, I need for the link to not use cache so that the query argument, which is handled differently by the Tornado server, to be treated.
Actually looking at the code, it looks like this is actually what happens (i.e. the cache is flushed only when flush_cache=false):
https://github.com/jupyter/nbviewer/blob/f93518c8252aec2c5c9bfcfd40bb70cbff7f0f77/nbviewer/providers/base.py#L528
@axil @moorepants Could either of you clarify what you mean by "the new variant"?
I don't think I understand.
The first line of the code checks the rate limiter here:
https://github.com/jupyter/nbviewer/blob/f93518c8252aec2c5c9bfcfd40bb70cbff7f0f77/nbviewer/ratelimit.py#L30
And then as far as I can tell, there isn't necessarily any emptying of the cache, it's just that the method proceeds without checking for any cached version, which may have the same effect as removing the page from the cache.