1

I'd like to cache some data to be used by all my requests. I'd like an in-memory cache that would get flushed upon the change of a code file (the information is obtained by reflection, and changing the code file will probably invalidate it). Is this possible without 3rd party external services (like memcached)?

Added: I know that webservers like apache create several worker processes. It's OK if they each have their own cache.

Vilx-
  • 104,512
  • 87
  • 279
  • 422

2 Answers2

2

You could use APC's cache instead of memcached. For example the apc_add function. Unfortunately APC is not standard installed with php, so it's not really without a 3rd party external service.

Leon
  • 829
  • 6
  • 8
0

Nope, PHP doesn't have an application scope like Java. The best you could do is session scope. However, you could easily setup something like Memcached to mimic application scope

JohnP
  • 49,507
  • 13
  • 108
  • 140