简体   繁体   English

php修饰符和缓存概念

[英]php modifiers & cache concept

Does Php have any modifiers like 'persistent' in java? Php是否在Java中有像“持久”之类的修饰符?

My purpose is to store Result sets which are retrieved from Database onto server RAM. 我的目的是将从数据库检索到的结果集存储到服务器RAM中。 When user next time searches for same values, I will not go to Database for retrieval again. 当用户下次搜索相同的值时,我将不会再去数据库进行检索。 Simply, I want to simulate cache on RAM. 简而言之,我想模拟RAM上的缓存。

I have no clue. 我没有任何线索。 Could anyone help me with this? 有人可以帮我吗?

No. Not really. 不,不是。

You could either cache the results to a file, then load it, or use something like memcached in front of your database to get this behaviour. 您可以将结果缓存到文件中,然后加载它,或者在数据库前使用类似memcached的方式来获取此行为。

Alternatively, you could store data in $_SESSION, but that would of course be per user rather than globally. 或者,您可以将数据存储在$ _SESSION中,但这当然是每个用户而不是全局的。

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

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