Closed mbretter closed 8 years ago
No. From the manual:
php://memory
andphp://temp
are read-write streams that allow temporary data to be stored in a file-like wrapper. The only difference between the two is thatphp://memory
will always store its data in memory, whereasphp://temp
will use a temporary file once the amount of data stored hits a predefined limit (the default is 2 MB).
i.e. for most cases Response
's body uses memory, unless it's going to be too big, in which case it will drop to using a temporary file.
thx
As a sidenote php://temp
is usually written to /tmp
which is most of the time mounted as tmpfs
which is stored in memory, and not disk. Your mileage may vary.
I'm caging my installations using apparmor, so I'm not using /tmp, however 2MB of html/xml/json/whatever output should be enough in most cases. On the other hand, exceeding this limit could result in a critical performance drop, especially on VMs where I/O is definitely a bottleneck. Maybe some doc hints would be good, or a config switch?
We'd welcome a PR to Slim-Website :)
hehehe :D
I've found that the response object creates the body by default from a tempfile, this means that for each request a tmpfile is created causing i/o.
wouldn't it be better to use:
by default instead?