{"_id":"@capgo/capacitor-asset-cache","_rev":"5-416958d75b7f16f22f0620711beed4a1","name":"@capgo/capacitor-asset-cache","dist-tags":{"latest":"8.1.3"},"versions":{"8.1.0":{"name":"@capgo/capacitor-asset-cache","version":"8.1.0","keywords":["capacitor","plugin","asset cache","persistent cache","cdn assets","media src","video cache","image cache","offline assets"],"author":{"name":"Martin Donadieu","email":"martin@capgo.app"},"license":"MPL-2.0","_id":"@capgo/capacitor-asset-cache@8.1.0","maintainers":[{"name":"riderx","email":"martin.donadieu@hey.com"}],"homepage":"https://capgo.app/docs/plugins/asset-cache/","bugs":{"url":"https://github.com/Cap-go/capacitor-asset-cache/issues"},"dist":{"shasum":"4eee622bfa7a26f2ac3a735a8622eb1236eca717","tarball":"https://registry.npmjs.org/@capgo/capacitor-asset-cache/-/capacitor-asset-cache-8.1.0.tgz","fileCount":27,"integrity":"sha512-OwxGWZ4BKTDsohymLF2BO0SbvhNoY3QvO/XagXZQK5qHqD8EvKU6yL4mkthSg1j94+CG8MjjpIe8c3yP5Yg0/g==","signatures":[{"sig":"MEUCIFxPqohAvsNLVNujtuNDVeIqYHZl2tJ0/FMt4x8JP1VIAiEAySFKcrhYzU4h6aRPpajZImMSTsW5gvqZPp9yytyJDts=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capgo%2fcapacitor-asset-cache@8.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":226531},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","gitHead":"48b55458d86b89968f01a98be071df175cd2df51","scripts":{"fmt":"bun run eslint -- --fix && bun run prettier -- --write && bun run swiftlint -- --fix --format","lint":"bun run eslint && bun run prettier -- --check && bun run swiftlint -- lint","build":"bun run clean && bun run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api AssetCachePlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint \"src/**/*.ts\"","verify":"bun run verify:ios && bun run verify:android && bun run verify:web","prettier":"prettier-pretty-check \"src/**/*.ts\" \"example-app/**/*.{css,html,ts,js}\" \"android/src/**/*.java\" --plugin=prettier-plugin-java","swiftlint":"node-swiftlint","verify:ios":"xcodebuild -scheme CapgoCapacitorAssetCache -destination generic/platform=iOS","verify:web":"bun run build","check:wiring":"node scripts/check-capacitor-plugin-wiring.mjs","example:build":"bun run build && cd example-app && bun install --frozen-lockfile && bun run build","prepublishOnly":"bun run build","verify:android":"cd android && ./gradlew clean build test && cd ..","example:install":"cd example-app && bun install --frozen-lockfile"},"_npmUser":{"name":"riderx","email":"martin.donadieu@hey.com"},"prettier":"@ionic/prettier-config","capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/Cap-go/capacitor-asset-cache.git","type":"git"},"_npmVersion":"11.13.0","description":"Capacitor plugin for transparent local caching of large images and videos.","directories":{},"_nodeVersion":"24.17.0","_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","eslint":"^10.4.0","rimraf":"^6.1.3","rollup":"^4.60.4","prettier":"^3.8.3","swiftlint":"^2.0.0","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^25.9.1","@capacitor/cli":"^8.3.4","@capacitor/ios":"^8.3.4","@capacitor/core":"^8.3.4","@capacitor/docgen":"^0.3.1","typescript-eslint":"^8.59.4","@capacitor/android":"^8.3.4","eslint-plugin-import":"^2.32.0","prettier-plugin-java":"^2.9.2","prettier-pretty-check":"^0.2.0","@ionic/prettier-config":"^4.0.0","eslint-config-prettier":"^10.1.8","@ionic/swiftlint-config":"^2.0.0"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-asset-cache_8.1.0_1782516476845_0.5140564220666239","host":"s3://npm-registry-packages-npm-production"}},"8.1.1":{"name":"@capgo/capacitor-asset-cache","version":"8.1.1","keywords":["capacitor","plugin","asset cache","persistent cache","cdn assets","media src","video cache","image cache","offline assets"],"author":{"name":"Martin Donadieu","email":"martin@capgo.app"},"license":"MPL-2.0","_id":"@capgo/capacitor-asset-cache@8.1.1","maintainers":[{"name":"riderx","email":"martin.donadieu@hey.com"}],"homepage":"https://capgo.app/docs/plugins/asset-cache/","bugs":{"url":"https://github.com/Cap-go/capacitor-asset-cache/issues"},"dist":{"shasum":"bf0ed788b34d4dcd67a4a4cc7c6a07f69de2049c","tarball":"https://registry.npmjs.org/@capgo/capacitor-asset-cache/-/capacitor-asset-cache-8.1.1.tgz","fileCount":27,"integrity":"sha512-l7Mjvzj4m5oSXHakg4F8K8lM7QOhlO91PT9f1PBq+9mM5qBUvKaR0qzBOcfGk7JVaemJ/jdROAM3rUltCElYaA==","signatures":[{"sig":"MEUCIFV65pjMtVdNejkTbsudFinFN8MN3j96MpIrwgrh/Jb1AiEAuRM5EdxQKVNoMlEJ9syF7GEXnF8NaT1Yfnq8TfB0cZU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capgo%2fcapacitor-asset-cache@8.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":226593},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","gitHead":"403809f9d1e2e88851d817ea6b3cc9c9dd0b7794","scripts":{"fmt":"bun run eslint -- --fix && bun run prettier -- --write && bun run swiftlint -- --fix --format","lint":"bun run eslint && bun run prettier -- --check && bun run swiftlint -- lint","build":"bun run clean && bun run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api AssetCachePlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint \"src/**/*.ts\"","verify":"bun run verify:ios && bun run verify:android && bun run verify:web","prettier":"prettier-pretty-check \"src/**/*.ts\" \"example-app/**/*.{css,html,ts,js}\" \"android/src/**/*.java\" --plugin=prettier-plugin-java","swiftlint":"node-swiftlint","verify:ios":"xcodebuild -scheme CapgoCapacitorAssetCache -destination generic/platform=iOS","verify:web":"bun run build","changelog:ai":"node scripts/generate-ai-changelog.mjs","check:wiring":"node scripts/check-capacitor-plugin-wiring.mjs","example:build":"bun run build && cd example-app && bun install --frozen-lockfile && bun run build","prepublishOnly":"bun run build","verify:android":"cd android && ./gradlew clean build test && cd ..","example:install":"cd example-app && bun install --frozen-lockfile"},"_npmUser":{"name":"riderx","email":"martin.donadieu@hey.com"},"prettier":"@ionic/prettier-config","capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/Cap-go/capacitor-asset-cache.git","type":"git"},"_npmVersion":"11.16.0","description":"Capacitor plugin for transparent local caching of large images and videos.","directories":{},"_nodeVersion":"24.18.0","_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","eslint":"^10.4.0","rimraf":"^6.1.3","rollup":"^4.60.4","prettier":"^3.8.3","swiftlint":"^2.0.0","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^25.9.1","@capacitor/cli":"^8.3.4","@capacitor/ios":"^8.3.4","@capacitor/core":"^8.3.4","@capacitor/docgen":"^0.3.1","typescript-eslint":"^8.59.4","@capacitor/android":"^8.3.4","eslint-plugin-import":"^2.32.0","prettier-plugin-java":"^2.9.2","prettier-pretty-check":"^0.2.0","@ionic/prettier-config":"^4.0.0","eslint-config-prettier":"^10.1.8","@ionic/swiftlint-config":"^2.0.0"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-asset-cache_8.1.1_1783762999573_0.4671189572298917","host":"s3://npm-registry-packages-npm-production"}},"8.1.2":{"name":"@capgo/capacitor-asset-cache","version":"8.1.2","keywords":["capacitor","plugin","asset cache","persistent cache","cdn assets","media src","video cache","image cache","offline assets"],"author":{"name":"Martin Donadieu","email":"martin@capgo.app"},"license":"MPL-2.0","_id":"@capgo/capacitor-asset-cache@8.1.2","maintainers":[{"name":"riderx","email":"martin.donadieu@hey.com"},{"name":"torichancapgo","email":"tori@capgo.app"}],"homepage":"https://capgo.app/docs/plugins/asset-cache/","bugs":{"url":"https://github.com/Cap-go/capacitor-asset-cache/issues"},"dist":{"shasum":"e7d1cd7324f067b3d6ea61732b3c0af551939677","tarball":"https://registry.npmjs.org/@capgo/capacitor-asset-cache/-/capacitor-asset-cache-8.1.2.tgz","fileCount":27,"integrity":"sha512-owF2/+rKmFSjWGULh2podoLn9DSTP2anzJ5BabzIjT/EJN6fz9M5gkigxDzzy3JYQohlOxwZRp5dnf4byDZz3w==","signatures":[{"sig":"MEQCIAO3ljUTqi5CM8gosq0dXtxdL6+s59HV5jIQYLY7OSuoAiBT27RAcLqBjhfax/oFCTv3N0cl8h+a00028pVVeM7toQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capgo%2fcapacitor-asset-cache@8.1.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":226593},"main":"dist/plugin.cjs.js","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","module":"dist/esm/index.js","gitHead":"7aef656f2bb8b8cc4f05b6e255cd20d3db54d72a","scripts":{"fmt":"bun run eslint -- --fix && bun run prettier -- --write && bun run swiftlint -- --fix --format","lint":"bun run eslint && bun run prettier -- --check && bun run swiftlint -- lint","build":"bun run clean && bun run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api AssetCachePlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint \"src/**/*.ts\"","verify":"bun run verify:ios && bun run verify:android && bun run verify:web","prettier":"prettier-pretty-check \"src/**/*.ts\" \"example-app/**/*.{css,html,ts,js}\" \"android/src/**/*.java\" --plugin=prettier-plugin-java","swiftlint":"node-swiftlint","verify:ios":"xcodebuild -scheme CapgoCapacitorAssetCache -destination generic/platform=iOS","verify:web":"bun run build","changelog:ai":"node scripts/generate-ai-changelog.mjs","check:wiring":"node scripts/check-capacitor-plugin-wiring.mjs","example:build":"bun run build && cd example-app && bun install --frozen-lockfile && bun run build","prepublishOnly":"bun run build","verify:android":"cd android && ./gradlew clean build test && cd ..","example:install":"cd example-app && bun install --frozen-lockfile"},"_npmUser":{"name":"torichancapgo","email":"tori@capgo.app","approver":{"name":"torichancapgo","email":"tori@capgo.app"}},"prettier":"@ionic/prettier-config","capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/Cap-go/capacitor-asset-cache.git","type":"git"},"_npmVersion":"11.19.0","description":"Capacitor plugin for transparent local caching of large images and videos.","directories":{},"_nodeVersion":"24.19.0","_hasShrinkwrap":false,"devDependencies":{"husky":"^9.1.7","eslint":"^10.4.0","rimraf":"^6.1.3","rollup":"^4.60.4","prettier":"^3.8.3","swiftlint":"^2.0.0","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^25.9.1","@capacitor/cli":"^8.3.4","@capacitor/ios":"^8.3.4","@capacitor/core":"^8.3.4","@capacitor/docgen":"^0.3.1","typescript-eslint":"^8.59.4","@capacitor/android":"^8.3.4","eslint-plugin-import":"^2.32.0","prettier-plugin-java":"^2.9.2","prettier-pretty-check":"^0.2.0","@ionic/prettier-config":"^4.0.0","eslint-config-prettier":"^10.1.8","@ionic/swiftlint-config":"^2.0.0"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/capacitor-asset-cache_8.1.2_1787226334610_0.8268494167289189","host":"s3://npm-registry-packages-npm-production"}},"8.1.3":{"_id":"@capgo/capacitor-asset-cache@8.1.3","bugs":{"url":"https://github.com/Cap-go/capacitor-asset-cache/issues"},"dist":{"shasum":"8a1b189b51879fe57ff1b0797b844546b36b3ef9","tarball":"https://registry.npmjs.org/@capgo/capacitor-asset-cache/-/capacitor-asset-cache-8.1.3.tgz","integrity":"sha512-JQyyDGUNTD5444k73/zyzcvGnZrtQFo3RZCkD9LrJJQxGAZr243UEmpgrQYKFRuj55+cqy7o25X+BUQeBCwn4g==","fileCount":27,"unpackedSize":226664,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@capgo%2fcapacitor-asset-cache@8.1.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIC6BzivqmOkmQ+KAZmBxP6reiyXj/xgWo94M8TskHJ8MAiBbDm0V9SDWyu+mkGQIK5h0xa54yasI8n8oXrilEq488w=="}]},"main":"dist/plugin.cjs.js","name":"@capgo/capacitor-asset-cache","types":"dist/esm/index.d.ts","unpkg":"dist/plugin.js","author":{"name":"Martin Donadieu","email":"martin@capgo.app"},"module":"dist/esm/index.js","gitHead":"ebc85d89285493ce87746e7c426c45cf63b040ca","license":"MPL-2.0","scripts":{"fmt":"bun run eslint -- --fix && bun run prettier -- --write && bun run swiftlint -- --fix --format","lint":"bun run eslint && bun run prettier -- --check && bun run swiftlint -- lint","build":"bun run clean && bun run docgen && tsc && rollup -c rollup.config.mjs","clean":"rimraf ./dist","watch":"tsc --watch","docgen":"docgen --api AssetCachePlugin --output-readme README.md --output-json dist/docs.json","eslint":"eslint \"src/**/*.ts\"","verify":"bun run verify:ios && bun run verify:android && bun run verify:web","prettier":"prettier-pretty-check \"src/**/*.ts\" \"example-app/**/*.{css,html,ts,js}\" \"android/src/**/*.java\" --plugin=prettier-plugin-java","swiftlint":"node-swiftlint","verify:ios":"xcodebuild -scheme CapgoCapacitorAssetCache -destination generic/platform=iOS","verify:web":"bun run build","changelog:ai":"node scripts/generate-ai-changelog.mjs","check:wiring":"node scripts/check-capacitor-plugin-wiring.mjs","example:build":"bun run build && cd example-app && bun install --frozen-lockfile && bun run build","prepublishOnly":"bun run build","verify:android":"cd android && ./gradlew clean build test && cd ..","example:install":"cd example-app && bun install --frozen-lockfile","check:cap9-deprecated":"node scripts/check-cap9-deprecated.mjs"},"version":"8.1.3","_npmUser":{"name":"torichancapgo","email":"tori@capgo.app","approver":{"name":"torichancapgo","email":"tori@capgo.app"}},"homepage":"https://capgo.app/docs/plugins/asset-cache/","keywords":["capacitor","plugin","asset cache","persistent cache","cdn assets","media src","video cache","image cache","offline assets"],"prettier":"@ionic/prettier-config","capacitor":{"ios":{"src":"ios"},"android":{"src":"android"}},"swiftlint":"@ionic/swiftlint-config","repository":{"url":"git+https://github.com/Cap-go/capacitor-asset-cache.git","type":"git"},"_npmVersion":"11.19.1","description":"Capacitor plugin for transparent local caching of large images and videos.","directories":{},"maintainers":[{"name":"riderx","email":"martin.donadieu@hey.com"},{"name":"torichancapgo","email":"tori@capgo.app"}],"_nodeVersion":"24.20.0","devDependencies":{"husky":"^9.1.7","eslint":"^10.4.0","rimraf":"^6.1.3","rollup":"^4.60.4","prettier":"^3.8.3","swiftlint":"^2.0.0","@eslint/js":"^10.0.1","typescript":"^6.0.3","@types/node":"^25.9.1","@capacitor/cli":"^8.3.4","@capacitor/ios":"^8.3.4","@capacitor/core":"^8.3.4","@capacitor/docgen":"^0.3.1","typescript-eslint":"^8.59.4","@capacitor/android":"^8.3.4","eslint-plugin-import":"^2.32.0","prettier-plugin-java":"^2.9.2","prettier-pretty-check":"^0.2.0","@ionic/prettier-config":"^4.0.0","eslint-config-prettier":"^10.1.8","@ionic/swiftlint-config":"^2.0.0"},"peerDependencies":{"@capacitor/core":">=8.0.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/capacitor-asset-cache_8.1.3_1789499377693_0.4133435940139938"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-26T23:27:56.690Z","modified":"2026-09-15T19:09:38.083Z","8.1.0":"2026-06-26T23:27:56.994Z","8.1.1":"2026-07-11T09:43:19.700Z","8.1.2":"2026-08-20T11:45:34.715Z","8.1.3":"2026-09-15T19:09:37.807Z"},"bugs":{"url":"https://github.com/Cap-go/capacitor-asset-cache/issues"},"author":{"name":"Martin Donadieu","email":"martin@capgo.app"},"license":"MPL-2.0","homepage":"https://capgo.app/docs/plugins/asset-cache/","keywords":["capacitor","plugin","asset cache","persistent cache","cdn assets","media src","video cache","image cache","offline assets"],"repository":{"url":"git+https://github.com/Cap-go/capacitor-asset-cache.git","type":"git"},"description":"Capacitor plugin for transparent local caching of large images and videos.","maintainers":[{"name":"riderx","email":"martin.donadieu@hey.com"},{"name":"torichancapgo","email":"tori@capgo.app"}],"readme":"# @capgo/capacitor-asset-cache\n\n<a href=\"https://capgo.app/\"><img src=\"https://capgo.app/readme-banner.svg?repo=Cap-go/capacitor-asset-cache\" alt=\"Capgo - Instant updates for Capacitor\" /></a>\n\n<div align=\"center\">\n  <h2><a href=\"https://capgo.app/?ref=plugin_asset_cache\">Get instant updates for your app with Capgo</a></h2>\n  <h2><a href=\"https://capgo.app/consulting/?ref=plugin_asset_cache\">Missing a feature? We will build the plugin for you</a></h2>\n</div>\n\nTransparent persistent media cache for Capacitor images, videos, and other large CDN assets.\n\n## Why Asset Cache?\n\n`@capgo/capacitor-asset-cache` lets app code ask for a media source and bind it directly to an `<img>`, `<video>`, React component, Vue template, or any other web UI.\n\n- Pass a CDN path like `videos/intro.mp4` and get a local display-ready URL back.\n- Uses persistent app storage: iOS Application Support and Android internal files.\n- `src(...)` and `resolve(...)` only resolve after a local file exists; if the plugin cannot create a local file, the call rejects.\n- `bind(...)` updates an image or video element from `loading` to `ready` when the local file is available.\n- Supports cache-only, TTL, ETag, Last-Modified, and always-revalidate modes.\n- Keeps lower-level `get`, `list`, `remove`, and `clear` helpers for advanced cache management.\n\nThe cache is removed when the app is uninstalled, but it is not stored in the platform cache directory that the system may flush under pressure.\n\n## Documentation\n\nThe most complete doc is available here: https://capgo.app/docs/plugins/asset-cache/\n\n## Compatibility\n\n| Plugin version | Capacitor compatibility | Maintained |\n| -------------- | ----------------------- | ---------- |\n| v8.\\*.\\*       | v8.\\*.\\*                | Yes        |\n| v7.\\*.\\*       | v7.\\*.\\*                | On demand  |\n\n## Install\n\n```bash\nnpm install @capgo/capacitor-asset-cache\nnpx cap sync\n```\n\n## Usage\n\nConfigure the CDN once, then bind media elements to CDN paths. The element only receives the local webview URL after the native fetch is done.\n\n```typescript\nimport { AssetCache } from '@capgo/capacitor-asset-cache';\n\nAssetCache.configure({\n  cdnUrl: 'https://cdn.example.com/assets/',\n  revalidate: {\n    strategy: 'ttl',\n    maxAgeSeconds: 86400,\n  },\n});\n\nconst video = document.querySelector('video');\nif (video) {\n  AssetCache.bind(video, 'videos/intro.mp4');\n}\n```\n\n```css\nvideo[data-asset-cache-state='loading'],\nimg[data-asset-cache-state='loading'] {\n  opacity: 0.4;\n}\n\nvideo[data-asset-cache-state='ready'],\nimg[data-asset-cache-state='ready'] {\n  opacity: 1;\n}\n```\n\n### React\n\n```tsx\nimport { useEffect, useRef } from 'react';\nimport { AssetCache } from '@capgo/capacitor-asset-cache';\n\nAssetCache.configure({ cdnUrl: 'https://cdn.example.com/assets/' });\n\nexport function HeroImage() {\n  const imageRef = useRef<HTMLImageElement>(null);\n\n  useEffect(() => {\n    if (!imageRef.current) return;\n\n    const binding = AssetCache.bind(imageRef.current, 'hero.jpg');\n    return () => binding.cancel();\n  }, []);\n\n  return <img ref={imageRef} alt=\"\" />;\n}\n```\n\n### Vue\n\n```vue\n<script setup lang=\"ts\">\nimport { onMounted, onUnmounted, ref } from 'vue';\nimport { AssetCache, type AssetCacheBinding } from '@capgo/capacitor-asset-cache';\n\nconst image = ref<HTMLImageElement | null>(null);\nlet binding: AssetCacheBinding | undefined;\n\nonMounted(() => {\n  if (image.value) {\n    binding = AssetCache.bind(image.value, 'hero.jpg', {\n      cdnUrl: 'https://cdn.example.com/assets/',\n    });\n  }\n});\n\nonUnmounted(() => binding?.cancel());\n</script>\n\n<template>\n  <img ref=\"image\" alt=\"\" />\n</template>\n```\n\n### Direct Source\n\nUse `src(...)` when your framework already manages loading state. It resolves only after the local file is ready.\n\n```typescript\nconst src = await AssetCache.src('images/hero.jpg');\n```\n\n### Protected Assets\n\nPass headers to the native fetch. The web element receives only the local file URL returned by the plugin.\n\n```typescript\nconst src = await AssetCache.src('private/videos/intro.mp4', {\n  cdnUrl: 'https://cdn.example.com/assets/',\n  headers: {\n    Authorization: `Bearer ${token}`,\n  },\n});\n```\n\n### Inspect the Resolution\n\nUse `resolve(...)` when you also want metadata about the local file resolution.\n\n```typescript\nconst source = await AssetCache.resolve('images/hero.jpg');\n\nconsole.log(source.src, source.fromCache, source.status);\n```\n\n### Advanced Cache Control\n\nUse `get(...)` directly only when you need the raw native file metadata.\n\n```typescript\nconst asset = await AssetCache.get({\n  url: 'https://example.com/videos/intro.mp4',\n  key: 'intro.mp4',\n  revalidate: { strategy: 'etag' },\n});\n```\n\n## Platform notes\n\n- iOS stores files under Application Support and excludes the cache root from iCloud backup.\n- Android stores files under the app internal files directory.\n- Web uses the browser Cache API and localStorage metadata as a development fallback.\n\n## API\n\n<docgen-index>\n\n* [`configure(...)`](#configure)\n* [`resolve(...)`](#resolve)\n* [`src(...)`](#src)\n* [`bind(...)`](#bind)\n* [`get(...)`](#get)\n* [`remove(...)`](#remove)\n* [`clear()`](#clear)\n* [`list()`](#list)\n* [`getCacheSize()`](#getcachesize)\n* [`getPluginVersion()`](#getpluginversion)\n* [Interfaces](#interfaces)\n* [Type Aliases](#type-aliases)\n\n</docgen-index>\n\n<docgen-api>\n<!--Update the source file JSDoc comments and rerun docgen to update the docs below-->\n\nPersistent asset cache for large Capacitor images, videos, and other media.\n\n### configure(...)\n\n```typescript\nconfigure(options: AssetCacheConfigOptions) => void\n```\n\nSet defaults for future `src(...)`, `resolve(...)`, and `bind(...)` calls.\n\n| Param         | Type                                                                        |\n| ------------- | --------------------------------------------------------------------------- |\n| **`options`** | <code><a href=\"#assetcacheconfigoptions\">AssetCacheConfigOptions</a></code> |\n\n--------------------\n\n\n### resolve(...)\n\n```typescript\nresolve(path: AssetCacheSourceInput, options?: AssetCacheSourceOptions | undefined) => Promise<ResolvedAssetSource>\n```\n\nResolve a CDN path or remote URL into a local display-ready source URL.\n\n| Param         | Type                                                                        |\n| ------------- | --------------------------------------------------------------------------- |\n| **`path`**    | <code><a href=\"#assetcachesourceinput\">AssetCacheSourceInput</a></code>     |\n| **`options`** | <code><a href=\"#assetcachesourceoptions\">AssetCacheSourceOptions</a></code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#resolvedassetsource\">ResolvedAssetSource</a>&gt;</code>\n\n--------------------\n\n\n### src(...)\n\n```typescript\nsrc(path: AssetCacheSourceInput, options?: AssetCacheSourceOptions | undefined) => Promise<string>\n```\n\nResolve a CDN path or remote URL into a local string ready for `img.src` or `video.src`.\n\n| Param         | Type                                                                        |\n| ------------- | --------------------------------------------------------------------------- |\n| **`path`**    | <code><a href=\"#assetcachesourceinput\">AssetCacheSourceInput</a></code>     |\n| **`options`** | <code><a href=\"#assetcachesourceoptions\">AssetCacheSourceOptions</a></code> |\n\n**Returns:** <code>Promise&lt;string&gt;</code>\n\n--------------------\n\n\n### bind(...)\n\n```typescript\nbind(element: AssetCacheBindableElement, path: AssetCacheSourceInput, options?: AssetCacheBindOptions | undefined) => AssetCacheBinding\n```\n\nBind an image or video element to a local asset and update it when ready.\n\n| Param         | Type                                                                    |\n| ------------- | ----------------------------------------------------------------------- |\n| **`element`** | <code>any</code>                                                        |\n| **`path`**    | <code><a href=\"#assetcachesourceinput\">AssetCacheSourceInput</a></code> |\n| **`options`** | <code><a href=\"#assetcachebindoptions\">AssetCacheBindOptions</a></code> |\n\n**Returns:** <code><a href=\"#assetcachebinding\">AssetCacheBinding</a></code>\n\n--------------------\n\n\n### get(...)\n\n```typescript\nget(options: GetAssetOptions) => Promise<CachedAsset>\n```\n\nResolve an asset URL into a local persistent file.\n\n| Param         | Type                                                        |\n| ------------- | ----------------------------------------------------------- |\n| **`options`** | <code><a href=\"#getassetoptions\">GetAssetOptions</a></code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#cachedasset\">CachedAsset</a>&gt;</code>\n\n--------------------\n\n\n### remove(...)\n\n```typescript\nremove(options: AssetCacheKeyOptions) => Promise<RemoveAssetResult>\n```\n\nRemove one cached asset by key or URL.\n\n| Param         | Type                                                                  |\n| ------------- | --------------------------------------------------------------------- |\n| **`options`** | <code><a href=\"#assetcachekeyoptions\">AssetCacheKeyOptions</a></code> |\n\n**Returns:** <code>Promise&lt;<a href=\"#removeassetresult\">RemoveAssetResult</a>&gt;</code>\n\n--------------------\n\n\n### clear()\n\n```typescript\nclear() => Promise<ClearCacheResult>\n```\n\nRemove every cached asset managed by this plugin.\n\n**Returns:** <code>Promise&lt;<a href=\"#clearcacheresult\">ClearCacheResult</a>&gt;</code>\n\n--------------------\n\n\n### list()\n\n```typescript\nlist() => Promise<AssetCacheListResult>\n```\n\nList cached assets that still exist on disk.\n\n**Returns:** <code>Promise&lt;<a href=\"#assetcachelistresult\">AssetCacheListResult</a>&gt;</code>\n\n--------------------\n\n\n### getCacheSize()\n\n```typescript\ngetCacheSize() => Promise<AssetCacheSizeResult>\n```\n\nReturn total cached asset bytes.\n\n**Returns:** <code>Promise&lt;<a href=\"#assetcachesizeresult\">AssetCacheSizeResult</a>&gt;</code>\n\n--------------------\n\n\n### getPluginVersion()\n\n```typescript\ngetPluginVersion() => Promise<PluginVersionResult>\n```\n\nReturns the platform implementation version marker.\n\n**Returns:** <code>Promise&lt;<a href=\"#pluginversionresult\">PluginVersionResult</a>&gt;</code>\n\n--------------------\n\n\n### Interfaces\n\n\n#### AssetCacheConfigOptions\n\nShared defaults used by `AssetCache.src(...)` and `AssetCache.resolve(...)`.\n\n| Prop             | Type                                                                                | Description                                        |\n| ---------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------- |\n| **`cdnUrl`**     | <code>string</code>                                                                 | Base CDN URL used when `path` is relative.         |\n| **`revalidate`** | <code><a href=\"#assetcacherevalidateoptions\">AssetCacheRevalidateOptions</a></code> | Default revalidation behavior for resolved assets. |\n\n\n#### AssetCacheRevalidateOptions\n\nRevalidation options for cached assets.\n\n| Prop                | Type                                                                                  | Description                                                                                                                                                                                                                    | Default              |\n| ------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------- |\n| **`strategy`**      | <code><a href=\"#assetcacherevalidatestrategy\">AssetCacheRevalidateStrategy</a></code> | `never` returns the local file when present. `ttl` re-downloads after `maxAgeSeconds`. `always` revalidates on every call and sends known validators. `etag` and `last-modified` use the matching HTTP validator when present. | <code>'never'</code> |\n| **`maxAgeSeconds`** | <code>number</code>                                                                   | Freshness window in seconds for the `ttl` strategy.                                                                                                                                                                            |                      |\n\n\n#### ResolvedAssetSource\n\nResult returned by `AssetCache.resolve(...)`.\n\n| Prop            | Type                                                | Description                                                                                         |\n| --------------- | --------------------------------------------------- | --------------------------------------------------------------------------------------------------- |\n| **`src`**       | <code>string</code>                                 | Local URL ready to assign to `HTMLImageElement.src`, `HTMLVideoElement.src`, or framework bindings. |\n| **`path`**      | <code>string</code>                                 | Original path passed by the caller.                                                                 |\n| **`remoteUrl`** | <code>string</code>                                 | Fully resolved remote URL used by the native fetch.                                                 |\n| **`key`**       | <code>string</code>                                 | Stable cache key used when one is known.                                                            |\n| **`local`**     | <code>true</code>                                   | Always true for successful `resolve(...)` calls.                                                    |\n| **`fromCache`** | <code>boolean</code>                                | True when the persistent local copy already existed before this call.                               |\n| **`status`**    | <code>'hit' \\| 'downloaded' \\| 'notModified'</code> | Result of the local source resolution.                                                              |\n| **`asset`**     | <code><a href=\"#cachedasset\">CachedAsset</a></code> | Native cached asset payload for the local file.                                                     |\n\n\n#### CachedAsset\n\nA cached asset stored in app-owned persistent storage.\n\n| Prop               | Type                                                | Description                                                      |\n| ------------------ | --------------------------------------------------- | ---------------------------------------------------------------- |\n| **`key`**          | <code>string</code>                                 | Stable cache key used by the plugin.                             |\n| **`url`**          | <code>string</code>                                 | Original remote URL.                                             |\n| **`path`**         | <code>string</code>                                 | Absolute native filesystem path.                                 |\n| **`uri`**          | <code>string</code>                                 | File URI that can be passed to `Capacitor.convertFileSrc`.       |\n| **`mimeType`**     | <code>string</code>                                 | Best known MIME type from the HTTP response.                     |\n| **`etag`**         | <code>string</code>                                 | Last known HTTP ETag validator.                                  |\n| **`lastModified`** | <code>string</code>                                 | Last known HTTP Last-Modified validator.                         |\n| **`size`**         | <code>number</code>                                 | File size in bytes.                                              |\n| **`updatedAt`**    | <code>number</code>                                 | Unix timestamp in milliseconds for the last successful download. |\n| **`checkedAt`**    | <code>number</code>                                 | Unix timestamp in milliseconds for the last cache check.         |\n| **`fromCache`**    | <code>boolean</code>                                | True when the returned asset came from local persistent storage. |\n| **`status`**       | <code>'hit' \\| 'downloaded' \\| 'notModified'</code> | Result of the cache lookup.                                      |\n\n\n#### ResolveAssetSourceOptions\n\nInput used by `AssetCache.src(...)` and `AssetCache.resolve(...)`.\n\n| Prop       | Type                | Description                                                                         |\n| ---------- | ------------------- | ----------------------------------------------------------------------------------- |\n| **`path`** | <code>string</code> | CDN-relative path or absolute remote URL for an image, video, or other media asset. |\n\n\n#### AssetCacheSourceOptions\n\nPer-asset options used by `AssetCache.src(...)` and `AssetCache.resolve(...)`.\n\n| Prop          | Type                                    | Description                                                                     |\n| ------------- | --------------------------------------- | ------------------------------------------------------------------------------- |\n| **`key`**     | <code>string</code>                     | Stable cache key. Include a file extension when the URL path does not have one. |\n| **`headers`** | <code>{ [key: string]: string; }</code> | HTTP headers sent while fetching or revalidating the asset.                     |\n\n\n#### AssetCacheBinding\n\nBinding returned by `AssetCache.bind(...)`.\n\n| Prop          | Type                                                                               | Description                                                           |\n| ------------- | ---------------------------------------------------------------------------------- | --------------------------------------------------------------------- |\n| **`promise`** | <code>Promise&lt;<a href=\"#resolvedassetsource\">ResolvedAssetSource</a>&gt;</code> | Resolves with the local source metadata after the element is updated. |\n\n| Method     | Signature     | Description                                                        |\n| ---------- | ------------- | ------------------------------------------------------------------ |\n| **cancel** | () =&gt; void | Prevents this binding from updating the element after it resolves. |\n\n\n#### AssetCacheBindOptions\n\nOptions used by `AssetCache.bind(...)`.\n\n| Prop                 | Type                | Description                                                  | Default                               |\n| -------------------- | ------------------- | ------------------------------------------------------------ | ------------------------------------- |\n| **`stateAttribute`** | <code>string</code> | Attribute updated with `loading`, `ready`, or `error`.       | <code>'data-asset-cache-state'</code> |\n| **`loadingClass`**   | <code>string</code> | Class added while the local file is being fetched.           |                                       |\n| **`readyClass`**     | <code>string</code> | Class added after the local file is assigned to the element. |                                       |\n| **`errorClass`**     | <code>string</code> | Class added when local resolution fails.                     |                                       |\n\n\n#### GetAssetOptions\n\nOptions used to resolve a remote asset into a local persistent file.\n\n| Prop             | Type                                                                                | Description                                                                                                                                                                      |\n| ---------------- | ----------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| **`url`**        | <code>string</code>                                                                 | Remote asset URL.                                                                                                                                                                |\n| **`key`**        | <code>string</code>                                                                 | Stable cache key. If omitted, the plugin uses a SHA-256 hash of `url`. Include a file extension when the asset will be used directly in an `&lt;img&gt;` or `&lt;video&gt;` tag. |\n| **`headers`**    | <code>{ [key: string]: string; }</code>                                             | HTTP headers sent while fetching or revalidating the asset.                                                                                                                      |\n| **`revalidate`** | <code><a href=\"#assetcacherevalidateoptions\">AssetCacheRevalidateOptions</a></code> | Controls when an existing persistent file should be checked again.                                                                                                               |\n\n\n#### RemoveAssetResult\n\nRemove result.\n\n| Prop          | Type                 | Description                                          |\n| ------------- | -------------------- | ---------------------------------------------------- |\n| **`removed`** | <code>boolean</code> | True when a cached file or its metadata was removed. |\n\n\n#### AssetCacheKeyOptions\n\nIdentifies an asset by cache key or by URL. `key` wins when both are set.\n\n| Prop      | Type                | Description                                      |\n| --------- | ------------------- | ------------------------------------------------ |\n| **`key`** | <code>string</code> | Stable cache key.                                |\n| **`url`** | <code>string</code> | Remote asset URL used to derive the default key. |\n\n\n#### ClearCacheResult\n\nClear result.\n\n| Prop          | Type                | Description                      |\n| ------------- | ------------------- | -------------------------------- |\n| **`removed`** | <code>number</code> | Number of cached assets removed. |\n\n\n#### AssetCacheListResult\n\nList result.\n\n| Prop         | Type                       | Description                                  |\n| ------------ | -------------------------- | -------------------------------------------- |\n| **`assets`** | <code>CachedAsset[]</code> | Cached assets that still have files on disk. |\n\n\n#### AssetCacheSizeResult\n\nCache size result.\n\n| Prop       | Type                | Description                       |\n| ---------- | ------------------- | --------------------------------- |\n| **`size`** | <code>number</code> | Total cached asset size in bytes. |\n\n\n#### PluginVersionResult\n\nPlugin version payload.\n\n| Prop          | Type                | Description                                                 |\n| ------------- | ------------------- | ----------------------------------------------------------- |\n| **`version`** | <code>string</code> | Version identifier returned by the platform implementation. |\n\n\n### Type Aliases\n\n\n#### AssetCacheRevalidateStrategy\n\nRevalidation mode used when an asset already exists in persistent storage.\n\n<code>'never' | 'ttl' | 'always' | 'etag' | 'last-modified'</code>\n\n\n#### AssetCacheSourceInput\n\nConvenience input accepted by `AssetCache.src(...)` and `AssetCache.resolve(...)`.\n\n<code>string | <a href=\"#resolveassetsourceoptions\">ResolveAssetSourceOptions</a></code>\n\n\n#### AssetCacheBindableElement\n\nElement supported by `AssetCache.bind(...)`.\n\n<code>HTMLImageElement | HTMLVideoElement</code>\n\n</docgen-api>\n","readmeFilename":"README.md"}