10

Recently we've been looking at a few exceptions captured in our Stack Overflow logs and have discovered an issue for Safari users.

I noticed this HTTP header in one of the exceptions we have captured:

HTTP_X_PURPOSE  preview

Does anyone know what action triggers this header or the meaning of HTTP_X_PURPOSE?

Geoff Dalgas
  • 6,116
  • 6
  • 42
  • 58

2 Answers2

11

The "X-Purpose: preview" header is definitely a Safari 4 top sites thing. The Top Sites page tries to show a live-ish thumbnail of the favourite pages. If favourite page is open in a tab, it grabs a thumbnail from the current version of the page. If a page is not available in an open tab, and the thumbnail is sufficiently out of date*, it makes a background request to get the current version of the page.

The X-Purpose: preview header is only attached to the HTTP request for the base URL. It is not attached to the resources (JS/CSS/images/flash) referenced on the page.

I've just written a blog entry on this over here: https://web.archive.org/web/20131115045854/https://sunpig.com/martin/archives/2010/01/08/how-to-detect-a-page-request-from-safari-4s-top-sites-feature.html

(* I haven't explored its criteria for "sufficiently out of date" yet.)

Ivar
  • 6,138
  • 12
  • 49
  • 61
  • 2
    “Instant” in Google Chrome sends it too. – Josh Lee Jan 01 '11 at 23:09
  • 1
    2018 update: It's used for more than Safari 4. Other browsers, and even the Facebook app itself, do this pre-fetching. For example, more info on Facebook's approach: https://www.facebook.com/business/help/www/1514372351922333 – rinogo Apr 17 '18 at 21:35
0

Might be sent when rendering for the Safari 4.0 Top Sites display mode? Haven't tested, just a guess.

  • I think it's Safari-related but I'm skeptical about Top Sites... a URL on our site got hit with it that a user would rarely visit. I'm wondering if there's a pre-fetch thing. Mozilla/5.0 (Macintosh; U; PPC Mac OS X 10_5_8; en-us) AppleWebKit/531.9 (KHTML, like Gecko) Version/4.0.3 Safari/531.9 – Tom Lianza Nov 03 '09 at 02:27