Skip to content

Releases: czhhbp/obsidian-on-demand-cache

1.0.9

Choose a tag to compare

@czhhbp czhhbp released this 12 Sep 08:47

Fixed the cache-folder documentation and made .cache the default.

What's changed

  • Default cache folder is now .cache: the default was previously cache. Both work equally well; .cache keeps the cached files tidily hidden inside your vault.
  • Corrected a documentation error: earlier docs stated the cache folder must be a non-hidden directory because Obsidian does not index hidden folders. This was wrong. FileSystemAdapter.getResourcePath encodes the absolute file path directly into an app:// resource-proxy URL, which Obsidian's renderer resolves by reading from disk — it does not depend on the vault's file index. Hidden folders such as .cache therefore render images correctly (verified on desktop, including after clearing Obsidian's HTTP cache and going offline).
  • Updated the README (English and Chinese) to reflect the corrected behavior and the new default.

Notes

  • No changes to caching behavior, link handling, filters, or commands.
  • Existing users keep whatever cache folder they have configured; only the default (used for fresh installs and when the field is cleared) changed.
  • Requires Obsidian 1.8.7 or later (unchanged).

This is a documentation/behavior-default fix. Upgrading is recommended.

1.0.8

Choose a tag to compare

@czhhbp czhhbp released this 11 Sep 12:12

Widened the "File extensions" input so the full list is always visible.

What's changed

  • Longer "File extensions" input: the text area now stretches to the full width of the settings pane and enforces a minimum width, so the entire comma-separated extension list fits on one line without truncation or awkward wrapping.
  • The input stays below its label/description, remains taller by default, is vertically resizable, and uses a monospace font for easier reading and editing.

Notes

  • No changes to caching behavior, filters, or commands.
  • Requires Obsidian 1.8.7 or later (unchanged).

This is a UI/UX polish release. Upgrading is recommended.

1.0.7

Choose a tag to compare

@czhhbp czhhbp released this 11 Sep 11:50

Improved the "File extensions" setting layout.

What's changed

  • File extensions input moved below its label: the input now sits under the setting name/description and spans the full width of the settings pane, so the entire extension list is visible at a glance.
  • The text area is taller by default, vertically resizable, and uses a monospace font.

Notes

  • No changes to caching behavior, filters, or commands.
  • Requires Obsidian 1.8.7 or later (unchanged).

1.0.6

Choose a tag to compare

@czhhbp czhhbp released this 11 Sep 11:07

Fixed Obsidian review errors and aligned the version number.

What's changed

  • Moved injected styles to styles.css: the plugin previously created a <style> element at runtime, which Obsidian's review flags as an error and a warning. All plugin styling now lives in the standard styles.css file that Obsidian loads automatically. This resolves:
    • Error: Creating and attaching "style" elements is not allowed.
    • Warning: Uses document.createElement instead of Obsidian's createEl helpers.
  • Version alignment: the manifest version now matches the release tag.

Notes

  • No changes to caching behavior, filters, or commands.
  • The file extensions input remains full-width, and clearing the cache still requires confirmation.
  • Requires Obsidian 1.8.7 or later (unchanged).

1.0.4

Choose a tag to compare

@czhhbp czhhbp released this 11 Sep 09:10

Hardened plugin startup for cross-platform (mobile) compatibility.

What's changed

  • Fixed a potential startup error on mobile: the diagnostic startup log evaluated adapter instanceof FileSystemAdapter unconditionally. Since FileSystemAdapter is a desktop-only class, this could throw a TypeError on iOS/Android if the class is unavailable at runtime. The check is now defensive — it verifies the class exists before using instanceof, so startup is safe on all platforms (Windows, macOS, Linux, iOS, Android).
  • Updated documentation: the README installation section now reflects that the plugin is officially available in the Obsidian community plugin store, with manual installation kept as a fallback.

Notes

  • No changes to caching behavior, settings, or commands.
  • Requires Obsidian 1.8.7 or later (unchanged).

This is a maintenance release. If you are on 1.0.3, upgrading is recommended but not urgent.

1.0.3

Choose a tag to compare

@czhhbp czhhbp released this 10 Sep 16:42

Added getSettingDefinitions() so settings appear in Obsidian's settings search (1.13.0+).

1.0.2

Choose a tag to compare

@czhhbp czhhbp released this 10 Sep 16:23

Fixed Obsidian review errors:

  • Raised minAppVersion to 1.8.7 to support getLanguage().
  • Replaced direct style assignment with setCssStyles().
  • Replaced instanceof HTMLElement with node.instanceOf(HTMLElement).
  • Added type assertions to eliminate unsafe assignments.

1.0.1

Choose a tag to compare

@czhhbp czhhbp released this 10 Sep 15:56

Fixed Obsidian review errors:

  • Raised minAppVersion to 1.8.7 to support getLanguage().
  • Replaced direct style assignment with setCssStyles().
  • Replaced instanceof HTMLElement with node.instanceOf(HTMLElement).
  • Added type assertions to eliminate unsafe assignments.

1.0.0

Choose a tag to compare

@czhhbp czhhbp released this 10 Sep 14:59

On-Demand Cache v1.0.0

Initial release.

What it does

On-Demand Cache downloads remote attachments (images, videos, audio, documents) only when you open a note, then transparently serves the local copy instead of the network file — while keeping your original links unchanged.

Key advantages

  • Your notes stay untouched: Unlike "download & replace" plugins, this plugin never rewrites your links. The original https://... URLs remain in your notes, so syncing only syncs link text, never large files.
  • On-demand, not bulk: Attachments are cached only when you open a note. No proactive mass downloading.
  • True offline access: Once cached, images and media display from the local cache even when you're offline.
  • Auto-fill across devices: Open a note on another device and missing attachments are downloaded automatically.
  • Content-hash deduplication: Identical files are stored only once, saving disk space.
  • Automatic cleanup: Unreferenced cache files are removed on startup.
  • Bilingual UI: English and Chinese, switching automatically with Obsidian's language.

Supported link formats

  • Markdown image: ![alt](https://...)
  • Markdown link: [text](https://...)
  • Obsidian wiki link: ![[https://...]], [[https://...]], [[https://...|alias]]
  • HTML tags: <img>, <audio>, <video>, <source>
  • Bare URL: https://...

Getting started

Note: This plugin is currently under review in the Obsidian community directory and is not yet installable from within Obsidian. Please use the manual installation below.

Manual installation:

  1. In your vault, create the folder .obsidian/plugins/on-demand-cache/ (create any missing parent folders).
  2. Download main.js and manifest.json from this release and place both files into that folder.
  3. Open Obsidian → Settings → Community plugins → Installed plugins.
  4. Find "On-Demand Cache" and toggle it on.

After enabling:

  1. Open any note containing remote attachments — they are cached automatically.
  2. To hide the cache/ folder from your file list, exclude it in your sync tool (e.g. add cache/ to .gitignore for Git).

Note: Caching is triggered only when a note is opened. Attachments inserted while editing are cached the next time you reopen the note.