![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Calibre cache
Hi, Kovid.
Would it be possible to disable caching of books not in calibre library? Or maybe add this as option to the viewer. Why am I asking this? Because I do a LOT of book downloads. They are all opened and checked for quality, before being added to the library or discarded. The problem is that every single book I open is then added to the cache. So, since calibre beta, this cache keeps growing (around 3 GB now). I know this might not be the user case for many users, but still, if was possible, this would be awesome. The alternative would be to clear the cache regularly, which would ruin my overall experience inside my library. Thanks in advance. P.S.: maybe I am wrong in the assumption this started with 4.0. If that's the case, then forget it. It wouldn't be an issue, since I have calibre for years and the cache would not be growing so fast after all. Last edited by thiago.eec; 10-19-2019 at 05:00 PM. |
![]() |
![]() |
![]() |
#2 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,718
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Couple of ideas
The cache can be relocated via the CALIBRE_CACHE_DIRECTORY environment variable. If you use Windows you could install portable and skim the book with it's viewer via windows open with - then you can clear its cache as and when you please. That blue one is in fact from 3.48, I changed its icon. BR |
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Thanks for the ideas, @BetterRed
Quote:
Well, that's an idea. Maybe, it would be even better to assign the portable viewer to be my default handler for EPUB and AZW3 files. This way I could just double-click the file. Inside calibre library, the default viewer would be used. |
|
![]() |
![]() |
![]() |
#4 | ||
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,718
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Quote:
The old viewer didn't unpack books to the cache folder, it unpacked them to a session folder in Temp, which gets deleted when calibre closes - and if it missed any they'd get removed next time you ran Disk Cleanup. BR Last edited by BetterRed; 10-19-2019 at 06:29 PM. |
||
![]() |
![]() |
![]() |
#5 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
Quote:
One problem though: it didn't work like expected. I even installed 4.1 portable just to be sure. Looks like calibre main cache is still used if you open a book directly. The portable cache is used only if you open the book from the main GUI... Well... this indicates that the main GUI and the Viewer DO save this setting on different variables/config files. So, maybe this could be changed for the default viewer, after all. |
||
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Simply create a bat file that does
set CALIBRE_CACHE_DIRECTORY=C:/whtever ebook-viewer %1 deltree C:/whatever and use that to launch the viewer. |
![]() |
![]() |
![]() |
#7 |
You kids get off my lawn!
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,220
Karma: 73492664
Join Date: Aug 2007
Location: Columbus, Ohio
Device: Oasis 2 and Libra H2O and half a dozen older models I can't let go of
|
Is there a way to clear the cache from within Calibre?
|
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,345
Karma: 27182818
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
No, the cache is managed automatically. IIRC any book that has not been read for 30 days will be purged the next time the viewer is opened.
|
![]() |
![]() |
![]() |
#9 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
|
Quote:
Just changed it a bit: Code:
@echo off set CALIBRE_CACHE_DIRECTORY=C:\whatever start ebook-viewer.exe %1 rd /s /q C:\whatever Well, then maybe it was not a real problem, after all... It wouldn't grow indefinitely. Last edited by thiago.eec; 10-20-2019 at 06:32 AM. |
|
![]() |
![]() |
![]() |
#10 |
Member
![]() Posts: 12
Karma: 10
Join Date: Jun 2010
Device: kindle
|
I just got many new books for the holidays and was surprised to see 1.8 gb of calibre cache being synchronized with all of my machines because I run calibre as a portable app in m/s OneDrive (but keep the library in a non-synching portion of my disk). That's a big problem on machines with only small SSD drives.
So, I tried the CALIBRE_CACHE_DIRECTORY fix [thanks for the tip] and it works great for use of the ebook viewer directly by double-clicking on the book to trigger the viewer, but if I double click on the book file type in calibre main window itself, the cache goes into the calibre settings directory. the CALIBRE_CACHE_DIRECTORY is ignored there. Any suggestions? I like to have calibre available on all machines in case a conversion is needed so would really like to keep it in OneDrive. Thanks! |
![]() |
![]() |
![]() |
#11 |
Member
![]() Posts: 12
Karma: 10
Join Date: Jun 2010
Device: kindle
|
well, since no assistance, I went back to 3.48 which not only doesn't have the huge gigabytes of caches, it also opens books lickety-split. I'm still cleaning up the gb of garbage on my backup disks since I let several generations occur before I noticed this cache problem.
I can open the Delphi Complete Harvard Classics in seconds with SumatraPDF, about 1/2 minute with amazon kindle for pc, a minute or two with ebookreader 3.48, and never was willing to wait longer than 10 minutes to see if ebookreader 4.xx would ever get it opened. I'll watch for progress on the new version of the ebookreader. I can understand the value of having a common code base, and see the logic behind thinking that decompressing an ebook would make it open faster on the second and subsequent times, but that assumes that we read on the same machine on which we use calibre reader. I use the reader mainly to get tables of contents to put into the calibre comment. I read on my Kindle or Kobo, so having the super long delay to open a book isn't a winner for me. I'd love to see a super fast, non-cache-ing reader for those who'd like one which is compatible with new releases of calibre. I tried copying the 3.48 into 4.x but get dll errors and it's not just one dependency, I guess, since I never got it to work. Regards, i |
![]() |
![]() |
![]() |
#12 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,718
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@iBookMan - try this, if you only want the ToC to paste into Comments, use the Book Editor's ToC Tool->Insert inline ToC. Save the resultant toc.xhtml, delete it from the book, and use the saved xhtml file as the source to update Comments.
BR |
![]() |
![]() |
![]() |
#13 |
Member
![]() Posts: 12
Karma: 10
Join Date: Jun 2010
Device: kindle
|
Thanks, BetterRed! I do, indeed, use the edit book function to create toc's when they're missing and it's a fantastic tool. It's just a lot of extra steps when the ebook viewer now has the [relatively new] ability to copy an existing toc with a single click. I got spoiled with that so am willing to keep using 3.48 to use it until the viewer gets back to normal speed, which i'm sure will happen sooner rather than later.
cheers! |
![]() |
![]() |
![]() |
#14 | |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,718
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Maybe a similar feature could be added to the Edit ToC tool - which is where I started looking for a solution. BR |
|
![]() |
![]() |
![]() |
#15 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Mar 2022
Device: Calibre
|
You could schedule a batch file to open the cache at regular intervals (e.g., weekly).
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
calibre 4 linux viewer symlinked .cache fail | Adoby | Calibre | 3 | 10-05-2019 05:52 AM |
How to clear cache? | odamizu | Kindle Developer's Corner | 8 | 04-11-2017 11:15 AM |
The Cache files in calibre | Dopedangel | Calibre Companion | 8 | 02-17-2017 01:58 AM |
Cache question re: Calibre Library Android app | martyh | Devices | 2 | 09-07-2012 12:55 AM |
Do recipes use a cache? | Starson17 | Calibre | 2 | 03-10-2010 10:05 PM |