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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T14:50:47+00:00 2026-05-29T14:50:47+00:00

For the sake of reducing HTTP requests for the UI assets (JS/CSS), I wrote

  • 0

For the sake of reducing HTTP requests for the UI assets (JS/CSS), I wrote a PHP script to combine these files and offer it as : “assets/basic,login,jquery-ui-10.css” and this works fine yet I decided to take it a little bit farther and ask the browser to cache these Assets Combiner (as I call them) by adding an expire header in the PHP script. Of course here i am making use of htacess RewriteRule functionality to reference for this script assets.php?files=basic,login,jquery-ui&type=css&version=10 to the one above to make it look like a CSS file for the browser to cache it (and it looks good this way :)). I also use the “version” parameter to force the browser to update the file, but that does not happen !!, I have added these header information to cache the file :

    header("HTTP/1.1 304 Not Modified");
    header("Expires: Sat, 1 Jun 2015 12:00:00 GMT");
    header("Cache-Control: must-revalidate");

Yet when I try change the version parameter in the URL string above it doesn’t download the new file content though the file name is changed > for the browser

What am I doing wrong here, how can I force the browser to re-download the new file > which is with a different name (but still sends the above headers)

Thanks in advance

  • 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-29T14:50:48+00:00Added an answer on May 29, 2026 at 2:50 pm

    As Quentin says, you MUST only send a 304 response in response to a IF-Modified-Since OR a If-None_match request. By sending a 304 response you are telling the browser to use the cached copy even if it doesn’t have one

    In practice, using 304 responses can actually defeat the purpose of improving performance and it’s usually better to ignore the conditional request and make a 200 response with content and new caching instructions

    If you want the content to be cached then send a max-age as well as an Expires header (the expires header is only required for HTTP/1.0 clients – all modern browsers implement HTTP1/1 – even when you explicitly tell them to use HTTP/1.0).

    e.g.

    header("Expires: Sat, 1 Jun 2015 12:00:00 GMT");
    header("Cache-Control: max-age=94608000,must-revalidate");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For simplicity sake, lets use the XML example on Econym's site. http://econym.org.uk/gmap/example_map3.htm Once clicked,
For examples sake, lets say I have a table containing these columns ID (primary
EDIT: For the sake of simplicity: I've got a simple UserJS script (FF/Chrome: Greasemonkey,
For the sake of learning C and understanding the difference between Binary Files and
For the sake of simplicity: There is a permission based system in place with
Just for the sake of experimentation, I've been trying to determine different ways to
For simplicities sake, I'll make up a similar example to what I have: Let's
For the sake of the example, consider a table create table foo ( contents
For the sake of education, and programming practice, I'd like to write a simple
For the sake of convenience I am trying to assign multiple values to a

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.