I’ve got a stylesheet that is dynamically generated, pulling its data from a database. Currently, in order to retrieve the stylesheet data I have to open a new database connection inside the file.
I was wondering if there actually exists any work around to ensure I don’t have more than a single db connection i.e. use the database connection that the rest of the pages are using instead.
yes, it will be a separate DB connection, as the file is a new request to the server. Why not just cache the rendered CSS server side so it doesn’t need to be rebuilt so often.
Just to clarify, are you talking about an external stylesheet?
In other words, you want to use the same database connection for when someone pulls data from your PHP page as the one you use when someone pulls an external CSS file (in a separate HTTP request)?
I know I’m a few days late in this thread, but thought I would check anyway…