以编程方式维护站点地图
希望有人能够提出一种理想的方法论。
我不想通过爬网程序运行我的网站 每个月向我的站点地图添加新页面,我都需要一些强大的系统方法来执行此操作,因为手动维护似乎很容易导致咳咳人类的健忘。是否有某种方法可以以编程方式验证某些特殊控制器的新控制器、控制器方法、视图等?我想象的是某种机制,每当您创建新的控制器方法或视图时,都会强制更新站点地图。如果相关的话,我在 LAMP 堆栈中工作。 这个人是通过文件系统执行此操作,这不是我想要的面向公众的站点地图。
除了我提出的概念之外,也许这种类型的维护还有另一种最佳实践。很想听听其他人是如何做到这一点的! :)
Hoping someone can chime in on an ideal methodology.
I don't want to run my site through a crawler every month to add new pages to my sitemap, I'd like some robust systematic method to do so, because maintaining it by hand seems very prone to ahem human forgetfulness. Is there some sorta way to programmatically validate new controllers, controller methods, views, etc. to some special controller? What I'm picturing is some mechanism that enforces updating the sitemap whenever you create a new controller method or view. I work in LAMP stack if that's relevant. This guy here is doing it through the file system and that's not what I want for a public facing sitemap.
Perhaps there's another best practice for this type of maintenance other than the concept I'm proposing. Would love to hear how everyone else does this! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您的网站是基于内容的,最佳实践是定期读取数据库并生成每个内容链接。使用此方法,您可以在站点地图中指定一些主题更优先,反之亦然。
该方法之前已经在您链接的主题中提到过。
另外,您可以在服务器端保存访问过的页面列表(静态)。或者只是记录它们。记录站点流量后,在不影响用户体验的情况下,我的意思是异步检查站点地图并在其中添加页面链接。您也可以通过访问页面的强度和一些统计逻辑来使用此方法指定优先级。
If your site is content based, best practise is reading database periodically and generating each contents link. With this method you can specify some subjects are more prior or vice versa in sitemap.
That method already mentioned before at topic that you linked.
Else, you can hold a visited pages list (static) at server-side. Or just log them. After recording your site traffic, without blocking the user experience, I mean asynchronously, check the sitemaps and add your page links there. You can specify priority with this method too, by visiting intensity of your pages and some statistical logic.