Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
WorkersでCMSを作ってみないか / Wanna build a CMS with W...
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Taiyu Yoshizawa
September 04, 2025
Technology
12
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
WorkersでCMSを作ってみないか / Wanna build a CMS with Workers?
Cloudflare Workers Tech Talks in Hokkaido #1 での発表資料
Taiyu Yoshizawa
September 04, 2025
More Decks by Taiyu Yoshizawa
See All by Taiyu Yoshizawa
MapLibre の CJK レンダリング / CJK Rendering in MapLibre
nekoya3
0
90
The Present and Future of CJK Rendering in MapLibre
nekoya3
0
13
Kartore: A Style Editor and Toolkit for MapLibre
nekoya3
0
20
Kartore: Maplibre のための Style Editor とその Toolkit
nekoya3
0
140
Flagship という素晴らしいもの / This awesome thing called Flagship
nekoya3
0
6
10分で完全に理解出来る Cloudflare Workers + HyperDrive / Cloudflare Workers + HyperDrive: You Might Understand It in Just 10 Minutes
nekoya3
0
26
Cloudflare Realtime と Workers でつくるサーバーレス WebRTC
nekoya3
1
2k
北海道新型コロナウイルスまとめサイトでのいろいろなこと
nekoya3
0
470
Other Decks in Technology
See All in Technology
eBPF 簡介 2026 版
shunghsiyu
0
170
Agent 活用環境の構築・運用のための AWS サービスのご紹介/agentcore-for-building-and-operating-agents
ren8k
1
320
これだけは抑えておきたい!後悔しない re:Invent の過ごし方 / AWS re:Invent 2026 prestudy
kinunori
2
680
複雑な業務システムを高速でつくるため、チーム全員をつくれる人へ
ayakurabuchi
0
120
構造で守らせる データ・法務・セキュリティ・開発チームとつくる AI時代のデータガバナンスとデータ基盤のリアル
legalontechnologies
PRO
3
790
AI AgentによるEmbedded SREの取り組み
tgidgd
1
330
Claude Codeから見る、エンジニアの世界の変容とその先
oikon48
8
5.3k
AIエージェント統制はAPIから——押さえるべき5つの要素
nagix
0
120
re:Invent2026 事前勉強会 歴史と愉しみ方10分LT編
toshi_atsumi
0
110
AI時代のエンジニアの情報発信〜個人の発信を組織の力に変える〜
ryo_kawamata
1
7.2k
Flutter Widget Previewerで始めるUIプレビューとVRTの自動化
sakusaku3939
0
200
200人の配信コメント、 全部Jevが仕分けます 〜 マサカリガードを作ってみた 〜
katayamatg
1
530
Featured
See All Featured
Believing is Seeing
oripsolob
1
260
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
1.1k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Heart Work Chapter 1 - Part 1
lfama
PRO
10
37k
How to train your dragon (web standard)
notwaldorf
96
6.9k
BBQ
matthewcrist
90
10k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
560
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
59k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.6k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
470
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
Darren the Foodie - Storyboard
khoart
PRO
4
4.1k
Transcript
WorkersでCMSを作ってみないか ɴᴇᴋᴏʏᴀsᴀɴ
Who are you? ɴᴇᴋᴏʏᴀsᴀɴ Software Engineer @MIERUNE Inc. Co-founder &
Software Engineer @ ReMotive GitHub: @NEKOYASAN Web: nekoyasan.me ←最近更新忘れて、メッチャ焦りました
What is ReMotive? エンタメ系の受託やら、Web制作やら、コンサルやらをして るちっさい2人会社 Workers使っていろいろやってたり、WebRTC x Live2D とか、Streaming Platformを作ってたり
おことわり まだ全然開発途中・サービスインの目処もまだしばらく先です 動くものを見せたかったんですが壊したので見せれません...ごめ んなさい.... 若干初心者向け(かも)
Motivation
None
None
Motivation Newtがサービス終了しちゃう microCMSはそれはそれで若干のつらみがある 金額的なところ 課金対象的なところ 仕様上のところ(画像・iframeまわりとか) Strapiとかを立てるのもそれはそれで辛みが... https://github.com/cloudflare/workerd/pull/4591 もしかしたらなんとかなったのかも...?
Motivation Newtがサービス終了しちゃう microCMSはそれはそれで若干のつらみがある 金額的なところ 課金対象的なところ 仕様上のところ(画像・iframeまわりとか) Strapiとかを立てるのもそれはそれで辛みが... https://github.com/cloudflare/workerd/pull/4591 もしかしたらなんとかなったのかも...? やっぱ自分で作るしかなくない?
Features
必ず欲しい セルフホストできる でもサーバーは持ちたくない... 安価に使える リッチエディタがあるか、Markdownで書ける モデルが自分で設定できる APIでアクセスできたり、画像上げれたり ログインとかメンバー管理とか
あったらいいな 画像最適化 予約投稿 Webhook 補助的なAI アクセス数解析
None
None
Cloudflare Developer platform AI Gateway Analytics Engine Assets Browser Rendering
D1 Durable Objects Hyperdrive Images KV Queues R2 Service Bindings Vectorize Workers for Platforms Workers AI Cache API
Cloudflare Developer platform AI Gateway Analytics Engine Assets Browser Rendering
D1 Durable Objects Hyperdrive Images KV Queues R2 Service Bindings Vectorize Workers for Platforms Workers AI Workflows こんだけあれば Workersでなんとかなるんじゃね
何が嬉しい? インフラを深く考える必要がない それなりに早い 色々周辺ツールが多い 帯域がタダ!!!!!! Cache操作系がやりやすい
Cloudflare Developer platform AI Gateway Analytics Engine Assets Browser Rendering
D1 Durable Objects Hyperdrive Images KV Queues R2 Service Bindings Vectorize Workers for Platforms Workers AI Cache API
Cloudflare Developer platform AI Gateway Analytics Engine Assets Browser Rendering
D1 Durable Objects Hyperdrive Images KV Queues R2 Service Bindings Vectorize Workers for Platforms Workers AI Cache API
構成図
Images Image R2 Master Data Cache D1 Worker Cache Durable
Object KV
Images Image R2 Master Data Cache D1 Worker Cache Durable
Object KV
R2 S3互換のオブジェクトストレージ 今回は画像・動画の保存用 Image 画像の変換とか軽量化ができるやつ 今回は画像最適化用
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 app.get("/*", async (c) => { const object = await c.env.TEST_BUCKET.get(key); if (object === null || !("body" in object)) { return c.text("Object Not Found", 404); } const format = c.req.query("format") || "image/avif"; const width = c.req.query("w") ? Number(c.req.query("w")) : undefined; const response = ( await c.env.IMAGES.input(object.body) .transform({ width: width, }) .output({ format: format as any }) ).response(); return response; })
めっちゃ簡単に画像最適化ができる
Images Image R2 Master Data Cache D1 Worker Cache Durable
Object KV
D1 サーバーレスのSQLデータベース SQLiteベースなので同じクエリが使える KV グローバルに一貫性のあるKey-Valueストア 高速アクセス・低レイテンシが魅力
なぜ使い分けるか? D1 は filter / sortに強いが若干遅い (KV比) KV は 早いが
filter / sort に弱い なので 初回取得時はD1から取得し、条件等と共にTTLをつけてKV に保管する 2回目以降はKVから取得する 書き換えが発生した場合はKVの 中身をclearする 管理画面からはD1をみれるAPIを使う
Images Image R2 Master Data Cache D1 Worker Cache Durable
Object KV
Durable Object 強整合性のあるデータストア WebSocketのコネクション持てたりするおもろいやつ SQLite in Durable Objectとかもある D1 も
Durable Object 上で動いてる(らしい) Alermっていうおもろい産物がある
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 import { DurableObject } from "cloudflare:workers"; export class AlarmExample extends DurableObject { constructor(ctx, env) { this.ctx = ctx; this.storage = ctx.storage; } async fetch(request) { const { seconds } = JSON.parse(request.body) let currentAlarm = await this.storage.getAlarm(); if (currentAlarm == null) { this.storage.setAlarm(Date.now() + 10 * SECONDS); } } async alarm() { // Alerm } }
めっちゃ簡単に予約投稿ができる
つらみ
つらみ D1にTransactionが存在しない KVのデータ変更タイミングでのリセット時にレスポンスが遅 くなる (D1に行くため) マルチテナントどうする問題
つらみ D1にTransactionが存在しない KVのデータ変更タイミングでのリセット時にレスポンスが遅 くなる (D1に行くため) マルチテナントどうする問題 → 何か良い案お持ちの方いたら懇親会とかで...
おまけ
Workers Analytics Engine テレメトリデータをStore / Getすることができるツール Cloudflareの内部で使われてる分析機能とおんなじ 1行につきindexとしての1つの値と、blob(string)が20個、 doubleが20個保管できるテーブルが用意されているイメージ Usage-based
Billingや不正利用検知に使える
1 2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 export default { async fetch(request, env, ctx) { env.ANALYTICS.writeDataPoint({ 'blobs': [ request.headers["CF-Connection-IP"] ], 'doubles': [ 1, 2, 4 ], 'indexes': [ userId, ] }); return new Response("Stored!"); }, };
まとめ 色んなサービスあります CMSつくってます!!! 画像最適化めっちゃ簡単なんでぜひ