top | item 43634043

(no title)

das_keyboard | 10 months ago

I don't really get it, but I'm also not using chrome, but looking at the website's source instead.

- Does the website actually do anything related to SXG?

- Would this also work if I search something completely different, goo offline and then just click on the first result?

- What is the point of the code if it's just hardcoded?

- What is the random progressbar doing? Just for visuals?

Edit: I explored a bit more and this blog post[0] by the OP would probably be a better entry-point for this post.

[0]: https://www.pawelpokrywka.com/p/stretching-google-prefetchin...

discuss

order

rapawel|10 months ago

Thanks for checking it out — and good questions.

You're right: the site is SXG-enabled, and the point of the demo is to show that Google can prefetch and serve it even when you're offline — but only if you search for a specific phrase on Google. Random searches won’t trigger the right preload.

The 4-digit code is intentionally hardcoded — it's not a security check, but a way to make sure the user follows the instructions and gives Google a bit more time to prefetch the content before going offline.

The progress bar also helps with timing — making sure the preload has a chance to complete.

After reading your comment, I added a link to a blog post in the final step of the instructions, in case the demo doesn't work as expected. (If the page is cached from an earlier visit, a refresh helps — it's got a long browser cache.)

Thanks again for digging into it!

blharr|10 months ago

I saw the code as kind of a clever joke, kind of a "gotcha" where it obfuscated the process to make it seem like it's relevant. That was my favorite part of the whole thing, realizing it's not magically sending data over in loading, it's just tricking you.