DWWW-CACHE(8)

πŸ’– DWWW-CACHE πŸ’–

okay bestie, welcome to dwww-cache β€” she manages the dwww cache of converted documents ✨ (she's part of dwww(7) btw, iykyk). The very first argument is the operation, and some operations are whole-cache girlypops that need literally nothing else from you. Others? They need the second and third argument to say the type and the pathname of the original document. (go peek at dwww-convert(8) if you want the tea on those arguments πŸ«–)


✨ SYNOPSIS ✨

dwww-cache --lookup type location
dwww-cache --store type location
dwww-cache --list type location
dwww-cache --list-all
dwww-cache --clean

πŸŽ€ DESCRIPTION πŸŽ€

So like, the way that dwww-cache works is she keeps a whole cache of converted documents and just. handles it. Iconic behavior honestly.

Here's the rundown of the operations, no gatekeeping:

  • --lookup β€” if the document is chilling in the cache, she outputs it to the standard output πŸ’…. If it's not there? She outputs nothing and returns a non-zero status. It's giving ghosted.
  • --store β€” she reads the document from the standard input, outputs it to the standard output, AND stores it into the cache. If there was an older version already sitting in the cache, bestie she removes it. out with the old, periodt.
  • --list β€” outputs information about one document in the cache to the standard output. The info is one line with five space delimited fields:
    1. type
    2. pathname of original file
    3. pathname of cached file
    4. size (actually the last two bytes of size πŸ‘€) of the cached file
    5. cache entry validity indicator β€” which can be either "valid" or "outdated"
  • --list-all β€” literally like --list, but for all documents. she said "everyone's invited" 🌈
  • --clean β€” forgets all cached documents that are already outdated. bye babes πŸ¦‹

dwww-cache maintains a database with information about the cached documents. The documents themselves are stored in separate files in the cache directory. And here's the thing β€” when old documents are removed from the cache by a suitable crontab entry, they will still exist in the database 😭. The --clean operation removes all entries from the database where either the original or the converted file is missing, or where the converted file is outdated.

To stop the cache from growing too large (no one wants that, it's giving hoarder), there should be an entry for dwww-refresh-cache(8) in system crontab to remove cached files that have not been accessed for a while. The dwww-refresh-cache(8) program internally uses commands similar to:

find /var/cache/dwww -atime +$DWWW_KEEPDAYS | xargs rm -f
dwww-cache --clean

...to remove all documents that have not been accessed for a number of days specified in the $DWWW_KEEPDAYS configuration variable. πŸ’–

The idea is to first delete the old cached files and then clean up the database. The policy of cleaning the cache has been kept outside of dwww-cache to keep the program simple, and to allow maximum flexibility. The default dwww installation creates a /etc/cron.daily/dwww, which automatically cleans the cache each day. self-care routine fr fr ✨


🌸 FILES 🌸

  • /var/cache/dwww/db β€” The cache directory.
  • /var/cache/dwww/db/.cache_db β€” The database with information about all cached documents.
okay so this one is a binary file, specially encoded for small size and high speed, and should not be touched by anyone but dwww-cache. hands off bestie, she's got it πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

dwww(7), dwww-convert(8). dwww-refresh-cache(8).


πŸ’œ AUTHOR πŸ’œ

Lars Wirzenius <liw@iki.fi>. Modified by Robert Luberda <robert@debian.org>.

See dwww(7) for copyrights and stuff.


and that's the whole vibe, bestie 🫢 this was dwww version 1.13.0, dated February 7th, 2016 β€” slay, iconic, no cap, mwah πŸ’…βœ¨πŸŽ€