Skip to content

Commit

Permalink
feat: try remove cache
Browse files Browse the repository at this point in the history
  • Loading branch information
dudu0506 committed Jun 21, 2024
1 parent aecfa89 commit 757c59a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/app/polls/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export async function generateMetadata({ params, searchParams }: PageProps): Pro
if (metadata) {
// update this to support hey.xyz
metadata['og:image'] = ogImage;
// try to disable cache
metadata['of:refresh_period'] = '0';
metadata['fc:frame:refresh_period'] = '0';
}

return {
Expand Down
2 changes: 1 addition & 1 deletion src/components/PollCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export function PollCard({ poll, theme, locale, profileId }: PollCardProps) {
}}
>
{choice_detail.map((choice, index) =>
is_end || !profileId || choice_detail.some((choice) => choice.is_select) ? (
(is_end || choice_detail.some((choice) => choice.is_select)) && profileId ? (
<VoteResult key={index} choice={choice} theme={themeConfig} />
) : (
<VoteButton key={index} theme={themeConfig} text={`${indexToLetter(index)}. ${choice.name}`} />
Expand Down
5 changes: 5 additions & 0 deletions src/helpers/createFrameSuccessResponse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,10 @@ export const createFrameSuccessResponse = (poll: Poll, queryData: ImageQuery) =>
return {
image: getPollFrameImage({ poll, queryData }),
buttons: getPollFrameButtons({ poll, queryData }),
imageOptions: {
headers: {
'Cache-Control': 'public, max-age=0',
},
},
};
};

0 comments on commit 757c59a

Please sign in to comment.