Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-19-2019, 04:54 PM   #1
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
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.
thiago.eec is online now   Reply With Quote
Old 10-19-2019, 05:37 PM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
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.

Click image for larger version

Name:	Annotation 2019-10-20 083258.jpg
Views:	1426
Size:	141.6 KB
ID:	174371


That blue one is in fact from 3.48, I changed its icon.

BR
BetterRed is offline   Reply With Quote
Advert
Old 10-19-2019, 05:55 PM   #3
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
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:
Originally Posted by BetterRed View Post
The cache can be relocated via the CALIBRE_CACHE_DIRECTORY environment variable.
Well, relocating the cache wouldn't stop it getting cluttered with unnecessary data from books that I will delete just after viewing. So, I don't see how moving it would help.

Quote:
Originally Posted by BetterRed View Post
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.
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.
thiago.eec is online now   Reply With Quote
Old 10-19-2019, 06:22 PM   #4
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,718
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by thiago.eec View Post
Well, relocating the cache wouldn't stop it getting cluttered with unnecessary data from books that I will delete just after viewing. So, I don't see how moving it would help.
I was thinking you could set it to say "c:\skimcache" before skimming new books and unset it when your done.

Quote:
Originally Posted by thiago.eec View Post
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.
if you use portable 4 you'd fill up the ...\Version 4 Portable\Calibre Settings\caches folder, if that's on drive C: then you'd be no better off, unless you cleaned it up manually.

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.
BetterRed is offline   Reply With Quote
Old 10-19-2019, 06:42 PM   #5
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by BetterRed View Post
I was thinking you could set it to say "c:\skimcache" before skimming new books and unset it when your done.
Oh, I see now. That could do it, but... I would have to remember always setting the environment variable before skimming. I'm sure I would forget half the time... lol

Quote:
Originally Posted by BetterRed View Post
if you use portable 4 you'd fill up the ...\Version 4 Portable\Calibre Settings\caches folder, if that's on drive C: then you'd be no better off, unless you cleaned it up manually.
That would not be a problem. I could clean this from time to time.

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.
thiago.eec is online now   Reply With Quote
Advert
Old 10-19-2019, 10:20 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Old 10-20-2019, 01:34 AM   #7
FizzyWater
You kids get off my lawn!
FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.FizzyWater ought to be getting tired of karma fortunes by now.
 
FizzyWater's Avatar
 
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?
FizzyWater is offline   Reply With Quote
Old 10-20-2019, 01:55 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Old 10-20-2019, 06:29 AM   #9
thiago.eec
Wizard
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 1,211
Karma: 1419583
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite, Kindle Oasis
Quote:
Originally Posted by kovidgoyal View Post
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.
Awesome! This is perfect. I changed the icon in the registry to match the viewer and now it looks exactly like before, but using a different cache.

Just changed it a bit:

Code:
@echo off
set CALIBRE_CACHE_DIRECTORY=C:\whatever
start ebook-viewer.exe %1
rd /s /q C:\whatever
Deltree is gone in windows.


Quote:
Originally Posted by kovidgoyal View Post
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.
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.
thiago.eec is online now   Reply With Quote
Old 12-31-2019, 09:37 AM   #10
iBookMan
Member
iBookMan began at the beginning.
 
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!
iBookMan is offline   Reply With Quote
Old 01-04-2020, 01:06 PM   #11
iBookMan
Member
iBookMan began at the beginning.
 
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
iBookMan is offline   Reply With Quote
Old 01-04-2020, 03:25 PM   #12
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
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
BetterRed is offline   Reply With Quote
Old 01-08-2020, 01:20 PM   #13
iBookMan
Member
iBookMan began at the beginning.
 
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!
iBookMan is offline   Reply With Quote
Old 01-08-2020, 01:37 PM   #14
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,718
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by iBookMan View Post
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!
I didn't know that even existed, but then I never wanted to copy a ToC.

Maybe a similar feature could be added to the Edit ToC tool - which is where I started looking for a solution.

BR
BetterRed is offline   Reply With Quote
Old 03-31-2022, 06:57 AM   #15
raywood
Junior Member
raywood began at the beginning.
 
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).
raywood is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 03:40 PM.


MobileRead.com is a privately owned, operated and funded community.