473,387 Members | 1,532 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Sharing instances over requests/sessions

Vic
Hi,

Is there a mechanism within PHP for sharing data over
multiple requests that are not tied to a specific session.

I need to write a memory senstive cache in pure PHP. I
have an application which needs to store documents
from an application server elsewhere, due to the data
within the documents I can't write them to disk and I
have to minimise the amount of accesses to the server.

So my plan is to write something to store the documents
in a cache avaliable to all requests and store an access
key in the session. When a request is made for a
document that is not in the cache I'll do a quick check
to see if I need to free some space before I add the new
document. However the actual docs to remove will most
likely belong to a different session.

The question is, how do I create an instance of my cache
so it is available over different requests and users.

This was a trivial exercise in a java servlet, however
I now need to use PHP.

Thanks,

Vic
Jul 17 '05 #1
1 1589
Regarding this well-known quote, often attributed to Vic's famous "1 Jun
2004 06:29:08 -0700" speech:
Hi,

Is there a mechanism within PHP for sharing data over
multiple requests that are not tied to a specific session.

I need to write a memory senstive cache in pure PHP. I
have an application which needs to store documents
from an application server elsewhere, due to the data
within the documents I can't write them to disk and I
have to minimise the amount of accesses to the server.

So my plan is to write something to store the documents
in a cache avaliable to all requests and store an access
key in the session. When a request is made for a
document that is not in the cache I'll do a quick check
to see if I need to free some space before I add the new
document. However the actual docs to remove will most
likely belong to a different session.

The question is, how do I create an instance of my cache
so it is available over different requests and users.

This was a trivial exercise in a java servlet, however
I now need to use PHP.

Thanks,

Vic


Can you just serialize the data (if you even need to), then dump it to a
file?

--
-- Rudy Fleminger
-- sp@mmers.and.evil.ones.will.bow-down-to.us
(put "Hey!" in the Subject line for priority processing!)
-- http://www.pixelsaredead.com
Jul 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: wh | last post by:
I really just need some reassurance that I'm doing the right thing really. Here goes... I have an object which needs to be available to all sessions. This is being created in the...
1
by: Augustin Prasanna. J | last post by:
Hi, When the user opens a new browser instance using 'Ctrl-N' and logs in with a different user login, both the browser instances begins to share the same session. Any suggestions on how to handle...
4
by: Daniel | last post by:
Hi I am having a problem sharing session between SSL and non-SSL asp.net pages I have F5 BigIP with sticky sessions working fine, but the problem is tha sticky session applies at the port level...
0
by: Daniel Malcolm | last post by:
Hi I have a site where I would like some pages to be accessed via SSL (login and payment etc) and others via regular http. However I'm not sure whether Session state can be maintained between...
4
by: qube3 | last post by:
We have applications written by JSP/Servlet and ASP.NET. All our future development would be based on ASP.NET. We wants to develop a single user interface so that users would not be aware that...
8
by: Michael Schwarz | last post by:
Hi, I have a problem where I have two requests (i.e. two different windows that are using the same session) that are accessing the session collection. The requests will need more time on the...
5
by: oliv | last post by:
Hi, New to .NET, I was wondering what was the proper way to share a variable between all the instances of a web page. I try with a static var, but it does not seem to always work. Why is that ? ...
9
by: Gilles Ganault | last post by:
Hello Some data are common to all user sessions, and to improve performance/save resources, I'd like to share those data between all sessions, so that each user doesn't have to hit MySQL for the...
7
by: =?Utf-8?B?Vkg=?= | last post by:
Hi, all. Need help with what seems to be either connection, or threading problem in my ASP.NET 2.0 application. The gist of the problem is this: IHttpHandler in my application serves an HTML...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.