Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 183187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:04:17+00:00 2026-05-11T15:04:17+00:00

I a working on a CMS and I want to be able to add

  • 0

I a working on a CMS and I want to be able to add CSS via the administrative control panel.

When I add css should I just append it to the bottom of the stylesheet I have or is it best to add the data to a DB and then get it using a handler.

The way I see it they both seem to have advantages.

writing to file:
It is simple and requires very little code
The file is portable and can be copied like any other css file

writing to a DB:
I have more control
I can load only the classes I need for each document

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:04:17+00:00Added an answer on May 11, 2026 at 3:04 pm

    Having done both in previous lives, I think the answer depends on who is maintaining the CSS.

    If it is a simple-interface for a non-technical user to manage a few simple styles, I would store this in the database, but as structured data, not raw CSS, and generate the CSS itself at run time. However as Sohnee mentions, you need to ensure it is not generated for every request, as this would be an unnecessary overhead – you should generate to a flat file, or cache effectively.

    If it is an interface for a web-developer type person, who understands the concepts of files, and you want to give them full access to write any css they like (and you trust them!) then I would store it as a file (if I were the developer, I would want it to be using my raw CSS). However, I would not append it to the existing stylesheet (assuming that is the default base set of styles for the site) I would have a separate stylesheet for user-defined styles, called in the page with a separate link tag. This will keep the site ‘code’ separate from its ‘content’. Note also what Zhaph – Ben Duguid says here about ensuring the browser does not cache old versions by adding some sort of version parameter to the URL.

    writing to a DB: I have more control I can load only the classes I need for each document

    I’d say only loading the classes per document would generally be a bad idea. Browsers are tuned for CSS caching, so you nearly always will be better off calling all your CSS from external files, with the appropriate caching headers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a WordPress CMS site and I want to add my own
I'm working on my CMS and I want it to log activities by users
I'm working on a CMS basically because I want to learn how to build
I am working on a CMS using CakePHP and I want to create a
I'm working on some custom Javascript for a CMS template at work. I want
I'm working with Orchard CMS and it is better CMS for me. I want
I am working on PHPmotion video cms website. I want to create API to
Here is my problem. I'm working within a CMS and users are able to
We have a CMS I created and it's working great but now I want
I am working on a CMS which supports multiple Language and i want drop-down

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.