简体   繁体   English

在PHP中传递大量数据

[英]Passing Large amount of data in PHP

I would like to know what is the best way to pass a large amount of XML data from one PHP script to another. 我想知道将大量XML数据从一个PHP脚本传递到另一个PHP脚本的最佳方法是什么。

I have a script that reads in an XML feed of jobs. 我有一个脚本,可读取作业的XML提要。 I would like to have the script display a list of the job titles as links. 我希望脚本将职位列表显示为链接。 When the user clicks a link they would be taken to another page displaying the details for that job. 用户单击链接时,将被带到另一个页面,显示该作业的详细信息。

The job details are too large to send in the query string, and it seems poor style to start a session for data that isn't specific to that user. 作业详细信息太大而无法在查询字符串中发送,因此为非特定于该用户的数据启动会话似乎风格很差。

Any ideas? 有任何想法吗?

I would cache the feed in database and display the details from there. 我会将提要缓存在数据库中并从那里显示详细信息。 The chances are this will also improve page performance, as you can serve many users with the same cached data, which you can refresh after lets say 30 mins or whatever is suitable. 因为您可以为许多用户提供相同的缓存数据,因此可以提高页面性能,您可以在说30分钟或合适的时间后刷新这些数据。

If you don't want/can read the XML files again, all you can is store it (preferably, in parsed form) somewhere. 如果您不想/不能再次读取XML文件,则可以将它存储在某个位置(最好以解析形式)。 See Native XML databases . 请参阅本机XML数据库

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM