elemes/services
opencode d7c845266c feat(assets): optimasi serving gambar (WebP on-the-fly + cache disk)
Arsitektur: upload tetap menyimpan original apa adanya; optimasi terjadi
saat serving — gambar raster di-resize (maks 1600px) + encode WebP
(quality 80), di-generate on-the-fly lalu di-cache di disk.

- config.CACHE_DIR = sibling ASSETS_DIR ('assets-cache'), WAJIB di luar
  ASSETS_DIR supaya export_bundle (os.walk tanpa filter) tetap lossless
- services/image_cache.py: varian WebP, cache key path+mtime+size+width,
  invalidasi otomatis via mtime, atomic write, fallback original bila gagal
- routes/lessons.py::send_assets: handler (bukan static serve) —
  .png/.jpg/.jpeg/.webp/.gif -> varian WebP; .svg & GIF animasi pass-through;
  ?orig=1 untuk original; ?w= untuk lebar alternatif; ETag + Cache-Control
- Dockerfile: buat /app/assets-cache writable

Test (services/tests/test_asset_cache.py, 20 test): lokasi cache di luar
ASSETS_DIR, cache reuse, invalidasi mtime, passthrough SVG/GIF animasi,
fallback file korup, ETag/304, dan acceptance test — upload -> request ->
export bundle berisi HANYA original tanpa .webp turunan.
2026-10-25 19:19:07 +07:00
..
scripts fix(markdown): sanitasi DOMPurify, perbaikan parser flashcard & kompatibilitas SSR Node 20 2026-08-28 05:24:44 +07:00
storage feat(quiz): izinkan guru melanjutkan attempt terminated dari jawaban tersimpan 2026-10-20 19:24:40 +07:00
tests feat(assets): optimasi serving gambar (WebP on-the-fly + cache disk) 2026-10-25 19:19:07 +07:00
__init__.py
…
database.py feat(teacher): manajemen akun guru canonical + first-run otomatis; cabut backend CSV (PG only) 2026-08-09 11:21:08 +07:00
docs_service.py fix(docs/api): hilangkan sync berulang di api_reference + UI API Reference di /docs 2026-08-17 16:37:30 +07:00
evaluation.py feat: unified lesson progress — composite score & /api/lesson-progress 2026-08-29 00:22:10 +07:00
image_cache.py feat(assets): optimasi serving gambar (WebP on-the-fly + cache disk) 2026-10-25 19:19:07 +07:00
lesson_registry.py fix(review): address code review findings for dev to master merge 2026-09-06 18:08:58 +07:00
lesson_service.py feat(student-management): sync imported progress with composite model and add inline expected format to CSV headers 2026-09-08 19:01:33 +07:00
models.py feat(quiz): izinkan guru melanjutkan attempt terminated dari jawaban tersimpan 2026-10-20 19:24:40 +07:00
progress_status.py feat(progress): composite scoring, roundtrip CSV grammar, and report export 2026-08-30 04:12:23 +07:00
repositories.py feat(quiz): izinkan guru melanjutkan attempt terminated dari jawaban tersimpan 2026-10-20 19:24:40 +07:00
student_roundtrip.py feat(student-management): sync imported progress with composite model and add inline expected format to CSV headers 2026-09-08 19:01:33 +07:00
teacher_auth.py feat(content-editor): konfirmasi ganda file navigasi kritis & hapus narrow sidebar 2026-08-23 08:18:02 +07:00
teacher_bootstrap.py feat(teacher): manajemen akun guru canonical + first-run otomatis; cabut backend CSV (PG only) 2026-08-09 11:21:08 +07:00
token_hashing.py
…
token_service.py feat(quiz): izinkan guru melanjutkan attempt terminated dari jawaban tersimpan 2026-10-20 19:24:40 +07:00