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

  • Home
  • SEARCH
  • 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 7410489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:14:30+00:00 2026-05-29T06:14:30+00:00

Here is my problem. Our tech. writer or customer service will often create new

  • 0

Here is my problem.

  • Our tech. writer or customer service will often create new or edit existing copies for out web app.
  • I need to store the text bits in the DB so the app can list, sort, etc… They will be relational too, but mostly for admin purposes (ex: get all texts that are related to payment, etc…)
  • Up to 30-40 different of these text bits could be displayed on one page.
  • I want to avoid running queries every time a page is rendered.
  • Text will be rendered on a page using a helper method.
  • The size of the collection won’t be that big. They are mostly copies for the site, but we don’t want our developers making copy changes.

I was thinking of a way to do this and had these ideas

  • Keep the texts in DB, but use Rails cache store to help serving them. Expire the cache upon updates, etc…
  • Use MongoDB to take advantage of its caching.
  • Store the texts in files and serve from the files

Maybe I am totally on a wrong path and handle this differently, but I am not sure what the best way to serve just a small amount of semi-dynamic texts other than making changes to the view file very often.

Any advice is welcome 🙂

Thanks

  • 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. Editorial Team
    Editorial Team
    2026-05-29T06:14:31+00:00Added an answer on May 29, 2026 at 6:14 am

    The fastest way to serve this content will be via memcached and easiest to setup in my opinion (less hassle then serving it form mongo). Save you content in database and cached on view level.

    So all you have to to is for example in view (please check this syntax from view as this goes out of top my head):

    <% Rails.cache(MyTextModel) %>
    <% end %>
    

    In your development:

    config.cache_store = :mem_cache_store, 'localhost:11211'
    

    or Production something like that if you run app on heroku:

      config.cache_store = :dalli_store, ENV['MEMCACHED_HOST'],
      { :compress => true, :username =>  ENV['MEMCACHED_USERNAME'],
         :password =>  ENV['MEMCACHED_PASSWORD']}
    

    Then add time_stamp in this model it automatically get expired. (you can also use Rails.cache without memcached or as File store but depends on your settings on server how much memory/space you can spare.

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

Sidebar

Related Questions

So here is our problem: We have a small team of developers with their
Here is part 1 of our problem (Loading a dynamically generated XML file as
Here is the problem: We have all of our development under subversion, but our
Here's our problem, we are a Flex shop that uses .NET for the server
Here is my problem: In our term there are two java courses. we have
Here is the problem : our main class (say : Contract) change every year.
I have one of our projects very strange problem here on http://konyak.georates.net/page-2/ we have
Maddening problem here. When my page loads: <body onload=getClientDateTime();> It runs this function: document.getElementById('ClientDateTime').value=hello
What is the problem here? (Besides having redundant code). $.getJSON works as expected. However
I have a problem here. My Zend_Forms do not render in view script. Via

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.