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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T07:11:41+00:00 2026-05-26T07:11:41+00:00

I am trying to create some sort of new filesystem for a PHP cache-serving

  • 0

I am trying to create some sort of new “filesystem” for a PHP cache-serving class. What I’m trying to achieve out of it, is the ability to detect which images are unique to each referrer URL from the site, through a MVC pattern type call to each image. Then to cache that, I want to pack every image into a single file, by utilizing PHP sessions. I’ll work out a system to determine with a session needs to be started, stream each image, and handle each http header. This is where it gets tricky.

So for example, say I have a url that loads a list of movie covers from localhost/images/moviecovers/movietitle001.jpg. I have it set up so each image would be loaded from images.php, with the rest of the URL as attributes. So it’s actually really easy to find out a complete list of images explicit to an HTTP referrer of localhost/media/movies/1.

I want to pack and group lists of images that are determined to frequently be called from a specific referrer on the site. I’ll probably make use of PHP sessions for this, by creating a session handler, and manipulating session names/ids/paths for organization. I haven’t done many benchmark tests, but I believe this is an efficient sorting system that’s extremely easy to work with.

It could allow me to do some sort of file structure like (with any other information that I might need):

//Unique to referrer of /images/moviecovers/...
$_SESSION = array(
    'image1'=>array(
        'type'=>'jpg',
        'modtime'=>filemtime(),
        'content'=>raw_image_data
    ),
    'image2'=>array(
        'type'=>'png',
        'modtime'=>filemtime(),
        'content'=>raw_image_data
    ),
    'image3'=>array(
        'type'=>'gif',
        'modtime'=>filemtime(),
        'content'=>raw_image_data
    ),
    ...
);

Ultimately, the goal is to make it so that I only need to open 2-3 files for a large list of images, but I need to find out how I’m going to keep those single files open throughout the entire client’s load. It should be easy to detect when a session needs to to be started, but the plan fails if I have to keep starting the session for each image that will be loaded. I’m not even sure where to begin on handling this type of thing in PHP, or if it’s even possible. I don’t necessarily need help with the design/framework, I need help and ideas with how I’m going to serve each request.

Even if it isn’t possible in PHP and since everyone knows of my plans, I’d also like some advice on why this would or wouldn’t be a good idea. Eventually, I might try making this in Node.JS, which I’m confident would have no problem handling
this type of thing. It’s one of those things I’d like to try, but have no idea if I would get any increase load quickness.

  • 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-26T07:11:42+00:00Added an answer on May 26, 2026 at 7:11 am

    How large is your raw image data. If it is large, all you are doing is trading memory usage for CPU usage.

    Also, you might need to be concern that PHP, on 32bit platforms can only use upto 1.5Gb of ram per request. (unless they have fixed it in newer versions).

    So this will restrict the number of images you can cache in the file. So I don really think it is a good idea to do so.

    With harddisk speed increasing and cost per gigabyte so low, what is the reason to cache it?

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

Sidebar

Related Questions

I am trying to create some dynamic html out of some data from db.
I am planning to create a screen saver. Thinking of trying out some WPF
I'm new to django and I'm trying to figure out how to create custom
I'm trying to create some HtmlHelper extensions and ran into a bit of a
I am trying to create some reusable components in Silverlight2 . The difficulty comes
I am trying to create some charts of data (eg http://www.amibroker.com/ ). Is there
I am trying to create some rules and facts on a certain situation. The
I am trying to create some global variables in a firefox extension. In my
I am trying to create some script variables in T-SQL as follows: /* Deployment
I'm trying to implement the WMD editor used on StackOverflow to create some basic

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.