NETCACHE(1)

πŸ“¦
version 3.2 Β· 3 versions
, in nixos 26.05, nixpkgs unstable, ubuntu resolute, ubuntu stonking

✨ NETCACHE β€” like, the local Internet cache handler for offpunk ✨

okay bestie, gather round, because netcache is genuinely one of those little tools that just works and we're gonna learn her together πŸ’… she's a command-line girlie from the General Commands Manual section, and honestly? iconic behaviour.


🌸 SYNOPSIS 🌸

netcache [--path] [--ids] [--offline] [--max-size MAX_SIZE]
         [--timeout TIMEOUT] [URL ...]
netcache -h | --help

that's it, that's the whole vibe check 🫢


πŸ’– DESCRIPTION πŸ’–

So. Netcache is a command-line tool that retrieves, caches and lets you access networked content β€” she's basically your personal little content stash πŸ’Ύβœ¨

By default, netcache will return a cached version of a given URL, and she only downloads it if a cache version doesn't exist yet. No cap. But wait, there's more β€” you can also hand her a validity duration, in seconds, and then she'll only download the content if the existing cache is older than that validity. It's giving "girl, are you expired or not" πŸ•°οΈ

You can also force her into offline mode, so she only fetches resources from the local cache. Otherwise she'd always refresh from the version available online β€” which, rude of her, but okay. This is also lowkey useful for mapping a given URL to its location in the cache, regardless of whether it's been downloaded first. iykyk πŸ—ΊοΈ

πŸŽ€ Positional arguments πŸŽ€

  • URL β€” download the URL and output the content. yes queen, just give her a link πŸ’–

🧚 Keyword arguments 🧚

  • -h, --help β€” show a help message and exit. the classic "help me pls" move πŸ™ˆ
  • --path β€” output the path to the cache instead of the content of the URL. so she tells you where the thing lives, not the thing itself πŸ“
  • --ids β€” return a list of id's for the gemini-site instead of the content of the cache. yes bestie, id's, plural, with the apostrophe, exactly like that πŸ’…
  • --offline β€” do not attempt to download, return the cached version instead, or error if it's absent from the cache. she stays home, no internet for her today πŸ›‹οΈ
  • --max-size MAX_SIZE β€” cancel download of items above that size. the value is expressed in megabytes. she's on a diet and it's called boundaries βœ‹
  • --timeout TIMEOUT β€” time to wait before cancelling the connection. the value is expressed in seconds. don't leave her hanging ⏳
  • --cache-validity -CACHE_VALIDITY β€” Maximum age (in second) of the cached version before redownloading a new version. yes the flag is literally written as --cache-validity -CACHE_VALIDITY, and yes the unit is "second" singular in the original, we do not fix what isn't ours to fix 😭

⭐ EXIT STATUS ⭐

The netcache utility exits 0 on success, and >0 if an error occurs.

so 0 = slay, anything above 0 = she's not okay, and honestly, relatable πŸ’€


🌈 ENVIRONMENT 🌈

Set the OFFPUNK_CACHE_PATH environment variable to use another location. like, go ahead, pick your own little home for her 🏑

OFFPUNK_CACHE_PATH=/home/ploum/custom-cache netcache.py gemini://some.url

periodt. that's the whole flex πŸ’–


πŸ¦‹ FILES πŸ¦‹

Default cache path is ~/.cache/offpunk. that's where she keeps all her stuff, no judgment ✨


πŸ‘‘ SEE ALSO πŸ‘‘

ansicat(1), migrate-offpunk-cache(1), offpunk(1), openk(1), and https://offpunk.net/ β€” the whole squad, fr fr 🫢


πŸ’œ AUTHORS πŸ’œ

Lionel Dricot (Ploum) <offpunk2 at ploum.eu> β€” thank you for your service, king πŸ‘‘


and that's the whole page, bestie! πŸ’– this little beauty is brought to you by Debian, dated November 25, 2024, and she's giving NETCACHE(1) main character energy from start to finish. go forth and cache responsibly 🌸✨

πŸ“¦ where this page comes from