php update website graphic

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
nga
Forum Commoner
Posts: 46
Joined: Mon Aug 17, 2009 3:05 am

php update website graphic

Post by nga »

hello guys, i uses php encode as css file (header('Content-type: text/css');) to allow admin to manage the look of the website (some main color, logo etc). However, the site's speed seem to decrease since it needs extra work to check the design preferences in the database (i assume so because it seems faster before and it doesnt have that much graphic...). Is there anyway to write the setting to a file (xml?) and have the php file to read from it rather than keep checking the database?

What's faster and what are the choices i have here?
User avatar
iankent
Forum Contributor
Posts: 333
Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom

Re: php update website graphic

Post by iankent »

The fastest way would be to write the CSS content to a .css file when its changed by admins, and then link to the 'static' CSS file from your HTML code.

You could save the info as XML but you'd still need to retrieve and parse the XML every time the CSS file is loaded.
Post Reply