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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:55:04+00:00 2026-05-22T00:55:04+00:00

I would like to represent dynamic images in an email. For example with the

  • 0

I would like to represent dynamic images in an email. For example with the given url

<img src="http://myserver.com/index.php/user_key/thispagestate.jpg" />

I would like to serve a different image based on logic within my server. There will only be between 2 to 4 static images used to represent the result of any given request.

The 2 options I had in mind were:

  1. to serve the images directly using perhaps
    imagecreatefromjpeg
  2. Or generate 302 redirects

Seeing as each request will result in one of a limited number of images I thought a redirect might save resources on our end and make use of caching on the user’s end too. The result for each request will change depending on the user and time, perhaps using redirects will have some consecuence for SEO or spam filtering?

Your opinions on the best method will be appreciated

  • 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-22T00:55:05+00:00Added an answer on May 22, 2026 at 12:55 am

    The 2 options I had in mind were:

    1. to serve the images directly using
    2. perhaps imagecreatefromjpeg Or
      generate 302 redirects

    I’d go with #1 in this case, though since it’s a static image you can simply use:

    header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1
    header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
    header('Content-Type: image/jpg'); // or image/png, etc.
    echo file_get_contents($image_path); // where $image_path is the path to the image
    exit;
    

    instead. You’d only need to use the GD functions if you’re were trying to do something like adding text on top of the static image.

    Note in this cache I’m setting it to cache expire, since the URL will be the same, but the content might change. This could potentially confuse caching systems.

    Seeing as each request will result in
    one of a limited number of images I
    thought a redirect might save
    resources on our end and make use of
    caching on the user’s end too.

    The reverse actually, since the same file will now have different content. You’ll want them to revalidate the content each time to make sure the proper image shows.

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

Sidebar

Related Questions

I have a string of raw HTTP and I would like to represent the
I have around 3500 flood control facilities that I would like to represent as
I have an array of integers which represent a RGB image and would like
I would like to sort a list of strings which represent paths. The sort
I would like to represent matrix-like data in a suitable data-structure in Java. The
I would like to represent the number 2.3421 as 2.34 but my current formatting
I would like to represent a value as a 64bit signed long , such
I would like to represent a datatype as a single column in my model,
My app uses monetary values, and I would like to represent these values in
I would like to represent a mutable graph in Prolog in an efficient manner.

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.