I'll be brief. There are a lot of services and features that need screenshots of other sites, such as various directories, search engine ranking checkers, subscriber previews, pop-up tips, etc. In the general case, something accesses the site, loads its page, somehow generates a screenshot and sends it to the requester. Now most often used third-party services, which is enough to turn on a specially created url and get a screenshot of the site in response.
But why all this is not done easier, more economical and predictable?
Screenshot generators often do not show previews immediately, because I don’t want to download them. Screenshots are often made once a day, a month, or even for years stuck in all sorts of caches, and webmasters cannot influence the situation. I suggest that site owners take screenshots of their own sites and give them to people.
')
The scheme is as follows. The webmaster manually or programmatically generates a screenshot of the site as it sees fit and puts it into http access, indicating the presence of a screenshot with a special meta tag. To do this, you can use an existing LINK tag, in the manner of favicon:
<link rel="screenshot" type="image/jpeg" title=" " href="http://example.com/path/to/screenshot.jpeg" />
Here
- rel = "screenshot" - an indication of the type of meta-information
- type = "image / jpeg" - resource mime type
- title = "Name" - the name for the site (or screenshot)
- href = " ... / screenshot.jpeg " - screenshot url
The tag is added to the HEAD section of the document, along with other meta tags that point to other resources associated with the page - css, favicons, etc. To get a screenshot, just extract the href parameter and load the file (or display it in the img tag), taking into account its mime -the type specified in the type parameter (after all, a screenshot can be made in jpeg, in png, and in svg).
pros
- Saving processor power
- On the speed dial browsers gets the "correct" screenshot (or a separate screenshot with rel = "speed dial")
- The webmaster can do the correct, in his opinion, screenshot
- Screenshot can be made up to date
- On a dynamically generated screenshot, you can display some information that people will see on other sites.
- Screenshot generators will be able to directly download the finished screenshot.
- For different tasks, you can display different screenshots by parameterizing the screenshot url
Minuses
- It is unclear what size and format (4: 3 or 16: 9) it is better to slip a screenshot. With favicons somehow easier.
Criticism is required.