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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:45:07+00:00 2026-05-28T00:45:07+00:00

I have a website that basically only displays things without any forms and post-gets.

  • 0

I have a website that basically only displays things without any forms and post-gets.
This website is PHP based and hosted on shared hosting. It rarely changes.
I would like to enable caching for this website.
Its shared hosting so i need a solution that:

  • does not use Memcached
  • dont need to move my website to VPS
  • dont use APC or other things

So basically what i would like to acomplish is cache every subsite to HTML and tell PHP to get for 5 minutes the HTML cached version of current subsite and display it to user. And after 5 minutes to refresh the cache.

I’ve been looking for some while on the internets and there are some tutorials and frameworks that support this kind of kinky cache.

But what i need is just one good library that is extremely easy to use.

I imagine it to work in this way:

<?

if (current_site_cache_is_valid())
{
   display_cached_version();
   die;
}

..mywebsite rendering code

?>

So simple as it sounds but i hope some good fellow developer did library of this kind before. So do you know such ready to use, not very time consuming to implement solution?

  • 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-28T00:45:07+00:00Added an answer on May 28, 2026 at 12:45 am

    This is how I normally do this, however I don’t know your URL design nor your directory / file layout.

    I do this with .htaccess and a mod_rewrite­Docs.

    The webserver checks if a cached HTML file exists, and if yes, it’s delivered. You can also check it’s age.

    If it’s too old or if it does not exists your PHP script(s?) is started. At the beginning of your script you start the output buffer­Docs. At the end of your script, you obtain the output buffer and you place the content into the cache file and then you output it.

    The benefit of this solution is, that apache will deliver static files in case they exist and there is no need to invoke a PHP process. If you do it all within PHP itself, you won’t have that benefit.

    I would even go a step further and run a cron-job that removes older cache-files instead of doing a time-check inside the .htaccess. That done, you can make the rewrite less complex to prefer a .php.cached file instead of the .php file.

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

Sidebar

Related Questions

Basically, we have an ASP website right now that I'm converting to PHP. We're
I have a website that basically allows customers to build a cart with an
I have a website that needs to send a POST to a website, than
i have a website which is basically a omegle copy ( text version only
I have a small project that basically a Python wrapper to a websites API.
I have a website that plays mp3s in a flash player. If a user
I have a website that I've just uploaded onto the Internet. When I browse
We have a website that uses #include file command to roll info into some
I have a website that is perfectely centered aligned. The CSS code works fine.
I have a Website that is really slow and feels really bad when using

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.