Delay in Updated Metadata Reflection on SEO Engines and Social Media Platforms: Seeking Insights on Timelines and Expedited Updates [migrated]

Hello Stack Overflow community,

Despite correctly implementing metadata tags within my web application, I’ve noticed a delay in their reflection on SEO engines and social media platforms like Facebook. The meta tags appear accurately when inspected within the section of the HTML. I’ve employed a code snippet that updates meta tags using the setMetaTags function triggered by the useEffect hook when currentPost is available. However, I’m curious about the time it takes for these changes to take effect in search engine results and platform previews. Any insights or estimated durations for when these platforms typically update their indexes and caches after metadata changes are made would be greatly appreciated. Below is the snippet of code used to update the meta tags:

useEffect(() => {
    if (currentPost) {
        setMetaTags();
    }
}, [currentPost]);

const setMetaTags = () => {
    if (typeof window !== 'undefined') {
        document.title = currentPost.title;

        // Setting description meta tag
        const descriptionMeta = document.querySelector(
            'meta[name="description"]'
        );
        if (descriptionMeta) {
            descriptionMeta.setAttribute(
                'content',
                currentPost.shortdescription
            );
        } else {
            const newDescriptionMeta = document.createElement('meta');
            newDescriptionMeta.setAttribute('name', 'description');
            newDescriptionMeta.setAttribute(
                'content',
                currentPost.description
            );
            document.head.appendChild(newDescriptionMeta);
        }

        // Setting image meta tag
        const imageMeta = document.querySelector(
            'meta[property="og:image"]'
        );
        if (imageMeta) {
            imageMeta.setAttribute('content', currentPost.image);
        } else {
            const newImageMeta = document.createElement('meta');
            newImageMeta.setAttribute('property', 'og:image');
            newImageMeta.setAttribute('content', currentPost.image);
            document.head.appendChild(newImageMeta);
        }
    }
};

Thank you in advance!