Skip to content

Commit

Permalink
Remove Frames Completely
Browse files Browse the repository at this point in the history
  • Loading branch information
Yoginth committed Dec 13, 2024
1 parent fb4e9a8 commit d577655
Show file tree
Hide file tree
Showing 12 changed files with 4 additions and 4,731 deletions.
87 changes: 0 additions & 87 deletions apps/api/src/helpers/frames/signFrameAction.ts

This file was deleted.

2 changes: 0 additions & 2 deletions apps/api/src/helpers/oembed/getMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import getProxyUrl from "./getProxyUrl";
import generateIframe from "./meta/generateIframe";
import getDescription from "./meta/getDescription";
import getEmbedUrl from "./meta/getEmbedUrl";
import getFrame from "./meta/getFrame";
import getImage from "./meta/getImage";
import getNft from "./meta/getNft";
import getSite from "./meta/getSite";
Expand All @@ -25,7 +24,6 @@ const getMetadata = async (url: string): Promise<null | OG> => {
const metadata: OG = {
description: getDescription(document),
favicon: getFavicon(url),
frame: getFrame(document, url),
html: generateIframe(getEmbedUrl(document), url),
image: getProxyUrl(image),
lastIndexedAt: new Date().toISOString(),
Expand Down
67 changes: 0 additions & 67 deletions apps/api/src/helpers/oembed/meta/getFrame.ts

This file was deleted.

152 changes: 0 additions & 152 deletions apps/api/src/routes/frames/post.ts

This file was deleted.

10 changes: 2 additions & 8 deletions apps/api/src/routes/oembed/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getRedis, setRedis } from "@hey/db/redisClient";
import { getRedis } from "@hey/db/redisClient";
import logger from "@hey/helpers/logger";
import sha256 from "@hey/helpers/sha256";
import type { Request, Response } from "express";
Expand Down Expand Up @@ -35,17 +35,11 @@ export const get = [
return res.status(200).json({ oembed: null, success: false });
}

const skipCache = oembed.frame !== null;

if (!skipCache) {
await setRedis(cacheKey, oembed);
}

logger.info(`Oembed generated for ${url}`);

return res
.status(200)
.setHeader("Cache-Control", skipCache ? "no-cache" : CACHE_AGE_1_DAY)
.setHeader("Cache-Control", CACHE_AGE_1_DAY)
.json({ oembed, success: true });
} catch (error) {
return catchedError(res, error);
Expand Down
Loading

0 comments on commit d577655

Please sign in to comment.