Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why are not the CSS externs?

Why the Style Sheets in all the Software forums, is generated in each page instead of can be generated in a files css externs???

Is because would give more load in the server??

Regularly with a

PHP Code:
<LINK HREF="file.css"

the visitants have faster downloads than using

PHP Code:

I think it's all stored in a database. It technically is external because it pops out a stylesheet from css.php when you give it an argument for a specific theme.
I know than all is stored in the database, the which give better performance, but the question is Why not are auto-generated diferents files,css , for each page
That would actually be fairly easy. For a mass-blog system I had a style.php file that would take a user account and subsection as parameters and output the correct CSS. When I came across a problem since Firefox demanded that it was text/css, I just did

header('Content-Type: text/css');

And I was done. So yeah. No idea why exactly I posted that. Just that it's easy Smile
That's what mybb is using though.
However, storing CSS should be up to the browser, FF is storing CSS files.
Users can now choose between retrieveing css from a text file and the database.
The CSS is still stored and modified from the database, but 'normal' users will only ever use the standard text files if you decide to use text file css.

CSS embedded in HTML documents (using style tags) is a bad idea. It increases HTML download times and your own bandwidth! This can add up to quite a lot depending on the size of the CSS used. Imagine a 3kb increase per page load for thousands of users on your site... External css can be cached by the browser.
Updated Site!
My mods
1.1: MyBB Zip Installer, Easy Install v2.0, Cash/Points plugin, PayPal/Subscriber, Reply by email, Advanced Plugins
I know this is an old topic but it hits on an improvement. Speaking of loading times, wouldn't it be quicker to load the css from a flat-file rather than a database query, especially since hosts usually watch database queries a lot closer than it looks after how people load HTML pages?

I just think it would be a good idea to use a flat-file system in future versions just to prevent the unnecessary queries to the database.
[Image: signature.gif]
You can choose between flat-file or database querying

Forum Jump:

Users browsing this thread: 1 Guest(s)