在ASPNET中,我逐渐爱上了Application和Cache存储。它们真的很棒。对于未经培训的人来说,您可以将数据逻辑对象投放到其中,然后,您只需要一次查询数据库就可以获得一些数据。
By far one of the best ASPNET features, IMO.
I ve since ditched Windows for Linux, and therefore PHP, Python and Ruby for webdev. I use PHP most because I dev several open source projects, all using PHP.
不用说,我已经探索了PHP在缓存数据对象方面所提供的功能。到目前为止,我已经尝试了:
- Serializing to file (a pretty slow/expensive process)
- Writing the data to file as JSON/XML/plaintext/etc (even slower for read ops)
- Writing the data to file as pure PHP (the fastest read, but quite a convoluted write op)
I should stress now that I m looking for a solution that doesn t rely on a third party app (eg memcached) as the apps are installed in all sorts of scenarios, most of which don t have install rights (eg: a cheap shared hosting account).
所以回到我现在正在做的事情,将持久化到文件是否安全?生产服务器安全的规则1
一直是禁用文件写入,但我真的看不到PHP在没有写入时如何缓存。有没有任何提示和/或技巧来提高安全性?
Is there another persist-to-file method that I m forgetting?
在“有限”的环境中是否有更好的缓存方法?