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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T15:22:54+00:00 2026-05-27T15:22:54+00:00

I have some local files, they are filled with pure json text. I have

  • 0

I have some local files, they are filled with pure json text.

I have a php script that serves them. I use php because it allows me to serve them in a zipped format, depending on the capabilities specified in the request. This is much leaner.

The php does this by getting an url parameter, fetching the file, and dumping its (zipped) output on the stream.

Still, now I’m wondering how to cache these files. How can I specify in the php code that the file will not have changed, so that the client can use a cached version of that response?

Or is there an option to serve these files statically in a zipped manner so caching is performed by the static web server? (I’m using httpd).

  • 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-27T15:22:54+00:00Added an answer on May 27, 2026 at 3:22 pm

    Apache 1.3 uses mod_gzip while Apache 2.x uses mod_deflate. You can compress you content without using php script dpending upon type of request. Use following lines in your apache config to deflate/gzip static content:

    AddOutputFilterByType DEFLATE application/javascript
    

    You can also add far future expire header for static content using apache. You do not need to use php script for that. Add this line to your apache config for static content:

    ExpiresActive On
    ExpiresDefault "access plus 4 hours"
    ExpiresByType application/javascript "access plus 1 year" 
    

    You can also add it to a .htaccess file in your static content directory

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

Sidebar

Related Questions

I have local html files that I need to know how they look like
i have a string like this one: $string = some text http://dvz.local/index/index/regionId/28 http://stuff.kiev.ua/roadmap_page.php http://192.168.3.192/roadmap_page.php
I have some text lines like that : vt_wildshade2^508^508 vt_ailleurs2^1188^1188 ... vt_high2^13652^13652 Is it
I have two projects in the same Subversion repository. They both use some standard
I have cloned a project that includes some .csproj files. I don't need/like my
I have some external configuration (XML files) that are installed in Maven. I need
I have an application that serves artifacts from files (pages from PDF files as
If I have have some overloaded ostream operators, defined for library local objects, is
I have been working on a django app on my local computer for some
I have some arbitrary pixel data that I want to save as a PNG.

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.