feat: Add cache-busting to avatar image URLs and implement show more/less functionality for certifications.

This commit is contained in:
pradeepkumar
2026-02-09 01:42:26 +05:30
parent dbdd22a84b
commit 7e8576c006
4 changed files with 73 additions and 13 deletions

View File

@@ -158,7 +158,14 @@ export default function AgentProfileView() {
if (profile.avatar && isS3Key(profile.avatar)) {
try {
const presignedUrl = await uploadService.getPresignedDownloadUrl(profile.avatar);
setAvatarUrl(presignedUrl);
// Add cache-busting parameter to force browser to fetch fresh image
// This prevents showing old cached image when avatar is updated
const profileWithTimestamp = profile as unknown as { updatedAt?: string };
const cacheBuster = profileWithTimestamp.updatedAt
? new Date(profileWithTimestamp.updatedAt).getTime()
: Date.now();
const urlWithCacheBuster = `${presignedUrl}&_t=${cacheBuster}`;
setAvatarUrl(urlWithCacheBuster);
} catch (avatarErr) {
console.error('Failed to get avatar URL:', avatarErr);
// Don't fail the whole page, just use default image