11 lines
480 B
MySQL
11 lines
480 B
MySQL
|
|
-- Long-term cache for page → image URL mappings extracted via og:image,
|
||
|
|
-- JSON-LD, or first content <img>. Fetching every recipe page on every
|
||
|
|
-- search is expensive; store the mapping with a 30-day default TTL.
|
||
|
|
CREATE TABLE thumbnail_cache (
|
||
|
|
url TEXT PRIMARY KEY,
|
||
|
|
image TEXT, -- NULL = page has no image (cache the negative too)
|
||
|
|
expires_at TEXT NOT NULL -- ISO-8601 UTC
|
||
|
|
);
|
||
|
|
|
||
|
|
CREATE INDEX idx_thumbnail_cache_expires ON thumbnail_cache(expires_at);
|