Reputation: 1377
I want save the editor content for 30s, and upload the content to server. If the browser have some problem or it closed. user can restore the content next time they login.
But I think, if the content save to the SQL, not good. I wondered if PHP has a cache function. Like memcache. The content is put in the cache, if the server restart, the cache can clear. and do not need write in SQL.
so, does PHP have a cache mechanism? Or can you give me a solution handle the content, must run quickly and the server must not require pressure.
Upvotes: 0
Views: 108
Reputation: 2572
PHP does have inherent cache implementation. It's called APC(alternative PHP cache). It should be turned on in php.ini. APC is of course server-side technology and has nothing to do with browser and javascript technologies. It's used for same reason memcached is used(and few others) - to give SQL Server some slack.
Upvotes: 0
Reputation: 45083
The client side has nothing to do with PHP, by the time the user receives the output that is the page, all of the PHP has been transformed. You could make this PHP's business, by means of pushing your cache data up to the server using AJAX. So, you need two solutions: one to manage data on the client side (say, using Javascript) and one to manage data from the client side on the server side (with PHP).
This is if you still want to use PHP, when you more than likely don't need to. Anyway, PHP does not have a built-in cache implementation that I am aware of, other than perhaps using $_SESSION
, you'll need to roll your own.
Upvotes: 2
Reputation: 365
there's no standart "inside" cache in php. You'll have to use either your own system, html5's localStorage or memcached/any other plugin. Memcached is definetely recommended though.
Upvotes: 1