• Resolved Anonymous User 18617817

    (@anonymized-18617817)


    Hi there and thank you for your awesome Plugin!

    I recently noticed Google Search Results for my page pointing to https://my-domain.com/?, and I’m wondering where the ? is coming from. I believe, it could be a caching issue:

    I tried the following:
    – Purging the Cache and preloading.
    – I then visited https://my-domain.com/?, and the cached version of https://my-domain.com/ got updated.

    Is that supposed to happen?

    I’m using TranslatePress, which dynamically changes hreflang urls. So all subsequent visitors receive a (cached) homepage where the hreflang urls look like this: https://my-domain.com/{lang_id}/?.

    I’ve no idea how to get rid of this ?. Any help would be greatly appreciated!

    • This topic was modified 3 years, 5 months ago by Anonymous User 18617817.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support vupdraft

    (@vupdraft)

    The ? is a query string. After the question mark you can pass key-value pairs and use them server-side.

    Here is a guide that you should find helpful;

    https://sitechecker.pro/site-audit-issues/query-string-contains-question-mark/

    Thread Starter Anonymous User 18617817

    (@anonymized-18617817)

    Thank you for your reply! I had a look at the link but it doesn’t solve my issue.

    My question is getting more clear by replicating these steps:

    1.) Open a random page which is currently cached by WP-Optimize.
    2.) Look at the Source Code and find the comment at the bottom:
    <!– Cached by WP-Optimize (gzip) – https://getwpo.com – Last modified: Sat, 10 Dec 2022 17:39:56 GMT –>
    3.) Manually add a /? to the url in the address bar and press enter.
    4.) Go back (remove the ? again), refresh and have a look at the last modified Date in the comment again. You will see, that the Date has changed.

    Why would that happen? Am I missing something? WP-Optimize doesn’t cache urls with Query Strings. Why does a single question mark cause the cache to be modified, when a full Query String like ?a=b does not?
    I may be totally wrong, but I think this behaviour might be the root cause for my little url problem mentioned above.

    Again, thanks for taking your time!

    Plugin Contributor Venkat Raj

    (@webulous)

    @boardingfk Yes, I can confirm that this is a bug and will be solved in our next release. However, I’m wondering how a URL with ? is ended up in google search results

    Thread Starter Anonymous User 18617817

    (@anonymized-18617817)

    Sounds great, thanks!

    So my theorie goes like this:
    1.) Someone visited our homepage with an /? at the end of the url.
    2.) Translatepress plugin looks at the url and changes the href attributes in the link-Elements accordingly:

    <link rel="alternate" hreflang="de" href="https://www.mydomain.com/?"/>
    <link rel="alternate" hreflang="en" href="https://www.mydomain.com/en/?"/>

    3.) The html file is then cached by WP-Optimize and served to all subsequent visitors of our homepage, including GoogleBot.
    4.) Google uses the urls from the link-Elements in the search results.

    Hope the next update of WP-Optimize will prove me right! 😉

    Plugin Contributor Venkat Raj

    (@webulous)

    @boardingfk Patch has been applied and will be available in version 3.2.11

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Weird caching issue’ is closed to new replies.