Skip to content

Commit

Permalink
patch: disable caching for tiktok.com #23
Browse files Browse the repository at this point in the history
since usually tiktok has a response time of 200ms, there really isnt any noticeable performance change with this patch
  • Loading branch information
okdargy committed Dec 28, 2024
1 parent ba2491e commit 3cfd1f3
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ async function handleVideo(c: any): Promise<Response> {

if (!awemeIdPattern.test(id)) {
const url = await grabAwemeId(id)
console.log('aweme url', url)
const match = url.pathname.match(awemeLinkPattern)

if (match) {
Expand Down
2 changes: 1 addition & 1 deletion src/services/tiktok.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function scrapeVideoData(awemeId: string, author?: string): Promise
Cookie: cookie.getCookiesAsString()
},
cf: {
cacheEverything: true,
cacheEverything: false,
cacheTtlByStatus: { '200-299': 86400, 404: 1, '500-599': 0 }
}
})
Expand Down
3 changes: 3 additions & 0 deletions wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,8 @@ vars = { WORKER_ENV = "production", BASE_URL = "https://fxtiktok-rewrite.dargy.w
name = "fxtiktok-rewrite-dev"
vars = { WORKER_ENV = "staging", BASE_URL = "https://fxtiktok-rewrite-dev.dargy.workers.dev" }

[observability.logs]
enabled = true

[env.local]
vars = { WORKER_ENV = "local", BASE_URL = "http://127.0.0.1:8787" }

0 comments on commit 3cfd1f3

Please sign in to comment.