Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Support Milind More

    (@milindmore22)

    Hello @culturalistpress

    Thank you for contacting us, as I mentioned before please check your cache mechanism, specially Cloudflare cache settings to check if it’s ignoring query parameters such as ?amp=1 or ?abc=1

    (screenshot)

    Here is a response header test example: https://geekflare.com/tools/tests/8rg8yjaim

    We cannot control Site’s cache behaviour with AMP plugin, so I will request you to check with the cache mechanism support.

    Thread Starter Lucas

    (@culturalistpress)

    Hi,

    I do not have cloudflare set to ignore query params. Also clearing cache on its own never resolves the issue. I double checked and my cache params for cloudflare are set to standard which according to them:

    “Standard: Delivers a different resource each time the query string changes.”

    Thanks,

    Plugin Support Milind More

    (@milindmore22)

    Hello @culturalistpress

    Thank you for checking that, then it might be the SG Optimizer plugin that might be ignoring query params, they documented a filter on the plugin listing page that we can use it.

    I will recommend adding the following code in your active themes functions.php or in a custom plugin using FTP or a tool like CPanel.

    add_filter( 'sgo_bypass_query_params', 'amp_add_sgo_bypass_query_params');
    function amp_add_sgo_bypass_query_params( $bypass_query_params ) {
        // Add custom query params for amp, that will skip the cache.
        $bypass_query_params[] = 'amp';
        return $bypass_query_params;
    }

    This will skip all AMP pages from being cached, let me know once you add the code.

    Thread Starter Lucas

    (@culturalistpress)

    I dont mean to be silly but don’t I really need my AMP pages cached since the whole point is to push on mobile performance as much as possible?

    In either case I set an exclusion in SG optimizer to exclude ?amp=* from cache – can you now check to see if this is even the issue?

    Thank you

    Plugin Support Milind More

    (@milindmore22)

    @culturalistpress

    Can you please clear the site cache (Site Ground) as well as purge Cloudflare cache?

    I dont mean to be silly but don’t I really need my AMP pages cached since the whole point is to push on mobile performance as much as possible?

    Yes, you are absolutely right, Cache is recommended for AMP pages to perform better.

    But since your cache plugin might be caching the pages while ignoring query parameters, which makes Google Search Console/AMP validator difficult to differentiate

    Eg:
    1) let’s suppose you visit a page normally (not an AMP page version with ?amp=1)
    2) SG optimizer plugin creates a cached version and serves the page.
    3) The plugin created a cached version then transmitted it to Cloudflare which creates a network cached version and serves users.
    4) since the plugin doesn’t honor query parameter requests it will server non-AMP version to both AMP (?amp=1) and non-AMP (/) requests

    What you can do?

    Use a different Caching plugin that also caches query parameter requests.
    OR
    Change the AMP plugin to Standard Mode.

    Thread Starter Lucas

    (@culturalistpress)

    Hi,

    I did clear the cache prior and have now.

    Also like I said earlier I don’t believe its the cache as when the error happens clearing all cache doesn’t result in resolution of error – Google reports the same error when rechecked.

    At this point I have excluded the query parameters as well.

    Are you sure its a cache issue?

    Plugin Support Milind More

    (@milindmore22)

    Hello @culturalistpress

    Thank you for getting back, Yes I am Positive that the cache plugin is the reason for the false-positive report, as I tested SG Optimizer on my local(test) site.

    I just checked and it looks like the query parameter exclusion code might be removed. as I am getting 304 responses for AMP pages.

    Once you add the query parameter exclusion code, clear plugin, as well as cloudflare cache, and check the AMP (with /?amp=1) and non-AMP (just / ) pages on AMP Test.

    The Google Search Console will update and remove errors once googlebots re-visit your site to validate AMP pages. the process may take 1-2 weeks.

    As I mentioned before you can consider a different caching plugin or Switching to Standard Mode

    Plugin Support Milind More

    (@milindmore22)

    @culturalistpress
    As we didn’t receive a response I’ll mark this as resolved. Feel free to open a new support topic if you require any further assistance.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘New pages get validation errors’ is closed to new replies.