dylangrech92 / seotoolbox

This plugin was created to facilitate SEO work by automating most of the manual labor
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

Partial caching conflict #33

Open jonom opened 7 years ago

jonom commented 7 years ago

Instead of seeing the proper contents of $Content in template output, a string such as [**[Content]**[CjxwPjIwMTY8L3A+CjxwPj (... etc...) L2E+PC9wPgo=]**] is rendered.

Steps to reproduce:

  1. Wrap a HTMLText field such as $Content in a <% cached %> block
  2. Flush cache
  3. Save and publish a page
  4. Visit that page

At this point, flushing the cache again fixes the issue. However, if you now go back to the CMS and do a flush there, then go back to the page and reload the page without flushing, the issue returns.

Or at least... those steps were working really well for a while, now they aren't. One of those tear your hair out intermittent issues I guess 😕

SEOToolboxControllerExtension seems to be putting that string together in crawl_response() but I can't work out why that method is getting called during this process. I've reached a bit of a dead end but maybe you have some ideas?

If nothing else, this provides a case for #27 :)

dylangrech92 commented 7 years ago

Interesting bug @jonom . On the top off my head and I don't have any ideas why this is happening but will have a look and try to figure it out :)

dylangrech92 commented 7 years ago

@jonom I couldn't replicate the issue at all however here are a few steps to take:

Note: crawl_response should ONLY be triggered when X-Crawl-Id header is present and matches the value that is set in the GlobalAutoLinkSettings::CrawlID this is done so that the controller can easily identify that something requested a crawl response. Also the CrawlID is a randomly generated string during dev/build and this also ensures that if the crawler fetches an external url which happens to be a Silverstripe site the other site will have it's own CrawlID therefore it will send a normal response and the crawler can then know that it fetched an external url.