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 6350639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T21:51:01+00:00 2026-05-24T21:51:01+00:00

I need a way to detect changes of my database because I’m implementing a

  • 0

I need a way to detect changes of my database because I’m implementing a caching system on a client’s site. (caching the whole page, not just the queries)

At the top of the every page (i have a “master page” so just one place in code) I query the database to see if its size is changed like so.

I sum the size and get a “unique” number. Compare it to the previous one, and if the values are the same, deliver the cached page, if not, run the “normal” page and then cache that.

So I think in theory this could work, because I have just 1 database query, and based on that deliver the site (cached or uncached depending on the result) to the user.

Could this work, and if not – why?

EDIT:

what about cheking for the last update timestamp? LINK

  • 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-24T21:51:02+00:00Added an answer on May 24, 2026 at 9:51 pm

    Who is updating the database? Suggest that the process causing the change should be the one invalidating your cache. When a user/admin causes a change to occur to the table, you could:

    • if the admin and the public-facing site share the same application space (i.e. they ARE the same app), then simply update the cache at the time the admin makes a change.
    • set a status bit somewhere (session variable perhaps), and periodically check to reload your cached data.

    Suggest size is not a good indicator of ‘change occurred’. Forget rows – what if a bool/bit value changes? That’d satisfy the condition to invalidate the cache, but the ‘size’ would always be the same. You could improve this with a last-change-datetime, but you’re still having the same basic problem – querying the database to check for a change flag. Kind of defeats the purpose of a cache.

    Consider another approach – reload your cache every n minutes. Whether there’s been a change or not, just reload it. n will be a value that fits in your business requirements. You could have stale cache, and be serving old/stale data for at most n minutes. This wouldn’t be my suggestions, but something to consider.

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

Sidebar

Related Questions

I need to find a fairly efficient way to detect syllables in a word.
I'm in need of a way to detect mobile browsers server-side. I'd like a
I'm trying to find a way to detect changes in which column the user
I need to reliably detect the state change of radio buttons/checkboxes on my page
Need a way to allow sorting except for last item with in a list.
I need a way to easily export and then import data in a MySQL
I need a way to recursively delete a folder and its children. Is there
I need a way to update the month value on a dateTime field in
I need a way to bind POJO objects to an external entity, that could
I need a way to build C++ code from UML diagrams and vice versa.

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.