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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T21:33:55+00:00 2026-06-12T21:33:55+00:00

Hmmm okay so quick question. My server has a simple php file that is

  • 0

Hmmm okay so quick question.
My server has a simple php file that is only updated lets say once a month. Now I absolutely DO NOT want the browser to check for an update until a certain period of time. Is this possible? My website specifically targets chrome users…I have an apache server and am currently using a header tag in my php:

 header("Cache-Control: max-age=25200");

Which above I am pretty sure still checks for an updated page.
BTW if anyone’s curious the reason the browser must not check for a new page is because the webpage is HUGE. I do not want to have be re-downloaded every day.

  • 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-06-12T21:33:56+00:00Added an answer on June 12, 2026 at 9:33 pm

    What you have is not a bad start, but you can improve it a bit, like so:

    header("Cache-Control: max-age=2592000 public");
    

    You can add expires http header response in your .htaccess:

    <IfModule mod_expires.c>
        Header unset expires
        ExpiresActive On
        Header set Expires "Mon, 5 Aug 2013 20:00:00 GMT"
    </IfModule>
    

    If you use expires, remember to set a specific date and not a rule based in access since that doesn’t work in dynamic generate content. The drawback of this, is that you have to update it from time to time.

    Of course, you can also set it in your php file with a time frame of a month from the requested time, that way, you don’t have to update the .htaccess and you always have a valid period.

    header('Expires: '.gmdate('D, d M Y H:i:s \G\M\T', time() + 2592000));
    

    You can add the pragma cache rule. Many modern clients don’t use it, but many mobile applications and validators use it.

    <FilesMatch "\.(php)$">
        Header set Pragma "cache"
    </FilesMatch>
    

    Many clients also consider the etag header, so it’s important to add, I use it on every project. You can do that in your .htaccess also.

    FileETag All
    

    Finally, if your site is not updated that often, the best way to improve cache and user experience, will be to have your php generate and html file and send it the client. That way, you have also the expires header working as intended and you can use compression from the server side, via apache or php.

    Bye

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

Sidebar

Related Questions

Hmmm. Okay after revisiting PInvoke, I'm sure that I don't quite get it :-/
Okay, so I'm writing a utility that compares 2 XML documents using Microsoft's XML
I was working on a program,that I need to support new additions. Hmmm. Let
I've got a pretty simple Linq to Sql statement that (on he surface) is
Hmmm All the answers I've seen here suggest that this should work, but... Is...
I know that an empty div is not hmmm entirely semantical. But I was
Hmmm...crappy question, but I didn't know how to phrase this: I have a sweet
I want to write several functions that are only different in the types of
Hmmm... the Java Iterator<T> has a remove() method but not a replace(T replacement) method.
Hmmm. Consider this program, whose goal is to figure out the best way to

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.