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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:22:36+00:00 2026-05-15T08:22:36+00:00

I have a website which maintenance I’ve inherited, which is a big hairy mess.

  • 0

I have a website which maintenance I’ve inherited, which is a big hairy mess.
One of the things I’m doing is improving performance. Among other things, I’m adding Expires headers to images.

Now, there are some images that are served through a PHP file, and I notice that they do have the Expires header, but they also get loaded every time.

Looking at Response Headers, I see this:

Expires Wed, 15 Jun 2011 18:11:55 GMT
Cache-Control   no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma  no-cache

Which obviously explains the problem.

Now, I’ve looked all over the code base, and it doesn’t say “pragma” anywhere. .htaccess doesn’t seem to have anything related either.

Any ideas what could be setting those “pragma” (and “cache-control”) headers, and how can I avoid it?

  • 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-15T08:22:37+00:00Added an answer on May 15, 2026 at 8:22 am

    Create a simple file that includes none of your PHP libraries but lives in the same folder as the file that serves up your images through a PHP file.

    file: test.php
    

    Request this file through a browser and check the headers. If you see the Response headers that you don’t want, you know that they’re configured via apache and not generated via a PHP file and you can concentrate your searches on .htaccess file in the directory tree, and on the http.confg and other included apache config files. You’ll want to search for

    <Directory....
    

    and

    <VirtualHost
    

    sections that may apply to your site.

    If you don’t see the headers in a request for that simple PHP file, you know that PHP is setting the headers somewhere. At the end of your image serving file (or right after it echos the image and exits), but the following PHP snippet)

    var_dump(get_included_files());
    

    Request an image through the image serving URL. That above snippet will print out all the PHP files used in the request. (you’ll probably need to view source or use curl to see the raw output, as the browser will report an invalid image)

    Having a subset of your files to work file, search through them for calls to the

    header();
    

    function. The header function is the only way (I think) that raw PHP code can set Response headers. You’ll also want to search for

    call_user_func
    eval
    $$
    

    in case there’s any dynamic code on the page that’s using PHP’s meta-programming capabilities to call the header function.

    Good luck!

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

Sidebar

Related Questions

I have a website which using active directory authorization on a windows server in
I have a website which contains a large (and wide) table. The table is
I have a website which has a lot of combo boxes and auto-complete textboxes
I have a website which displays a lot of photos, built with asp.net and
I have a website which sells a product to the user (downloadable). I am
I have a website which fetches information from RSS feeds periodically (well, currently manually,
I have a website which allows secure (ssl) file uploads and download. The site
I have a website which works with PHP on the server side. Users access
I have a website which uses Spring Security. I have realized that when I
I have a website which uses jQuery and lots of mouseover / mouseout effects.

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.