Skip to content

Commit 1487513

Browse files
committed
feat: Increase cache
1 parent 413e5cf commit 1487513

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

src/api/axios.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import recaptchaInterceptor from "./interceptors/recaptcha";
55

66
const axios = setupCache(Axios, {
77
methods: ["post"],
8-
ttl: 1000 * 60 * 10,
8+
ttl: 1000 * 60 * 20,
99
});
1010

1111
axios.defaults.timeout = 1000 * 10;

src/services/fetchAttachment.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ async function fetchAttachment(encryptId: string): Promise<any> {
1414
},
1515
{
1616
timeout: 15 * 1000,
17+
cache: {
18+
ttl: 1000 * 60 * 60 * 2,
19+
},
1720
}
1821
);
1922
return response.data;

src/services/fetchCourses.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ async function fetchCourses(): Promise<Course[]> {
1212
cache: {
1313
// This route is not expected to change frequently
1414
// So we can cache it for a long time
15-
ttl: 1000 * 60 * 30,
15+
ttl: 1000 * 60 * 60 * 2,
1616
},
1717
});
1818

0 commit comments

Comments
 (0)