[1] RSS の guid
要素は、
項目を固有に識別する文字列を表します RSS 2.0。
仕様書:
[5] 要素の内容は、項目を固有に識別する文字列です RSS 2.0。
[7] この文字列 (guid) の構文は特に規定されていません RSS 2.0。
[9] フィードの供給元は、この文字列が固有であることに責任を負っています RSS 2.0。
[10] この要素を指定し、かつそれを permalink とする
(isPermaLink
を
false
としない) ことが推奨されています RSS 2.0。
[13] isPermaLink
が true
(既定値)
の場合には、内容は項目に関連付けられた Web頁の
permanent URL でなければなりません
RSS Best Practices Profile。
[14] isPermaLink
が false
の場合には、
固有性が保証される文字列なら何でもいいですが、
tag:
URL が例として挙げられます。
RSS Best Practices Profile
[6] この要素が存在する場合、集積器は項目が新しいものか判断するためにこの要素の文字列を使うことができます RSS 2.0。
<guid>http://some.server.com/weblogItem3207</guid>
<guid isPermaLink="true">http://inessential.com/2002/09/01.php#a2</guid>
<guid isPermaLink="false">2296 at http://example.com/blog</guid>
[19] 『ジオどす』 京都通り名住所検索 ジオコーダー - 京都通り名ジオコーダーAPI『ジオどす』 ( 版) <http://geodosu.com/rss.xml>
<guid isPermaLink="false">48 at http://geodosu.com</guid>
<guid>http://dallas.example.com/1983/05/06/joebob.htm</guid>
<guid isPermaLink="false">tag:dallas.example.com,4131:news</guid>
<guid isPermaLink="false"></guid>
[11] guid
要素は link
要素と似ています。
両者は一致するシステムもあるでしょうし、そうでないシステムもあります
RSS 2.0。
<link>https://ja.wordpress.org/2016/03/17/wordpress-4-5-beta-4/</link>
<pubDate>Thu, 17 Mar 2016 13:24:29 +0000</pubDate>
<dc:creator><![CDATA[Naoko Takano]]></dc:creator>
<category><![CDATA[Development]]></category>
<category><![CDATA[Releases]]></category>
<guid isPermaLink="false">https://ja.wordpress.org/?p=3857</guid>
<link>http://info.cocolog-nifty.com/info/2016/03/post-20d8.html</link>
<guid isPermaLink="true">http://info.cocolog-nifty.com/info/2016/03/post-20d8.html</guid>
<link>http://blog.nicovideo.jp/2015/12/1212.php</link>
<guid>http://blog.nicovideo.jp/2015/12/1212.php</guid>
Clients often need to identify whether a torrent has already been downloaded or not just by inspecting the item. For this reason, RSS feeds SHOULD include a guid field. If practical, the guid SHOULD be the info-hash of the torrent. That way, GUIDs would match across different feeds.
[20] この要素に意味があるのかどうかは謎です。 意図としては同じ記事の URL が変化する場合などに対処したかったのでしょうが...
Google RSS Readerの場合、<guid>にisPermalink=trueの属性がない場合でも、<guid>に指定されたURLがハイパーリンクとして機能する。
Firefox 2.0の場合、<link>に指定されたURLがハイパーリンクとして機能する。
changing the GUID will mean that many feedreaders will suddenly display your content in the user's reader again as if it was new content, possibly annoying your users.
In order for the GUID field to be "globally" unique, it is an accepted convention that the URL or some representation of the URL is used. Thus, if you own example.com, then you're the only one using example.com and thus it's unique to you and your site. This is why WordPress uses the permalink, or some form thereof, for the GUID.
However, the second part of that is that the GUID must never change. Even if you shift domains around, the post is still the same post, even in a new location. Feed readers being shifted to your new feeds when you change URLs should still know that they've read some of your posts before, and thus the GUID must remain unchanged.
Never, ever, change the contents of the GUID column, under any circumstances.
[29] さて、世の中に guid
を記事の URL と解釈する実装があるので、
移転したのに元の GUID を保持しろというアドバイスと両立させるには、
旧 URL から新 URL にリダイレクトでもするしかないことになります。
[30] 普通は URL の変更なんて誰もしたくないので、 それでもせざるを得ないということは、それなりの事情があるはずです。 当面はリダイレクトするとしても、その状態をいつまで維持できるかどうか。 例えばドメインを移転したら、いつまで旧ドメインを保持し続けるか。 もしドメインが他の人の手にわたったら、その人は違う使い方をしたいかもしれない。
[31] URL の寿命が短い状況で、 URL を固有識別子として使おうという方針が、 根本的に間違っているのです。 (しかも固有識別子なのになぜか URL としても使うというのが謎すぎる。)