doutouman6245 2011-12-07 14:39
浏览 30
已采纳

PHP脚本或Cron作业从XML SiteMap加载页面(用于缓存目的)

I am trying to determine how I want to tackle this... this is all new to me. My site (I did not build it) has caching in place but a page only caches if it is visited.

What I was thinking is that if I have an xml sitemap with all my pages, use that as a check list and have a script load (or "visit") those pages to cache them once a day.

Is this even possible? Has anyone here done something similar? As you might be able to tell, I am kinda new at PHP...

If anyone could help point me in the right direction, it would be very much appreciated. Ideas, steps, functions, etc.

Thank you!

  • 写回答

1条回答 默认 最新

  • duanjue2576 2012-03-08 15:07
    关注

    I have found out that if you properly code your site (mysql queries specifically), correctly and efficiently, there is no need to have caching in place. I spent a few days re-writing the functions and queries that do the same thing but don't create unwanted lag and unnecessary queries.

    If anyone else is having similar issues, I urge you to optimize your code... ask for help if you need but you shouldn't have to cache a site unless it requires a ton of queries per page load and the page doesn't change daily.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献