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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T21:25:18+00:00 2026-05-28T21:25:18+00:00

Is there a way to cache background image. For example.. Background image is 3x3px

  • 0

Is there a way to “cache” background image.

For example..
Background image is 3x3px and it’s set like this:

body {
    background: #000 url(bg.png);
}

When refresh happens, background image “flickers” for second.

Is there a cross-browser solution? (for Apache/PHP server if that is relevant)


If you go to seo.hr and browse navigation,… you can see what I’m trying to do.

http://www.seo.hr/

http://www.seo.hr/usluge/izrada-stranica

http://www.seo.hr/usluge/optimizacija-za-trazilice

  • 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-28T21:25:19+00:00Added an answer on May 28, 2026 at 9:25 pm

    I think you need to determine first if the issue actually is a caching issue or if it’s caused by the size of your image. You could use a program like Wireshark or Fiddler to do this, but to be honest it’s overkill for your need and you probably already have a browser with developer tools.

    Here’s how you determine where an image is coming from in Chrome (the other browsers are similar).

    1. Open your developer tools and go to the “Network” tab.
    2. Find “bg.png” in the list of network requests and click on it’s name. Below is an example of having selected a stack overflow image from this page.

    Google Chrome Image Retrieved from Cache

    Notice that it says status 200 (from cache). The browser didn’t need to go out to the server and rerequire that resource. It used the cache. If that “from cache” text wasn’t there it wasn’t reusing cached resources.

    There is also the potential that you’ll get a status code of 304. That means that the server said the image wasn’t modified since the last request that you made. You do make the server trip in that case.

    Ok, so my image wasn’t in cache… now what?

    There are a few reasons that this could occur.

    1. You’re request headers aren’t set to tell the browser to cache the image (also found in that same “Headers” tab that you would have seen that Status Code if the browser actually went to the server for the image). You’ll want to set cache-control and expires to something that makes sense for you. Cache headers can get a bit complicated you may want to browse through this caching tutorial document.
    2. Is it SSL? If so not all browsers cache this but most modern browsers do. Set cache-control: public on these images (and also expires).

    The real question here is how do you fix this? Unfortunately, that’s entirely dependent on the server and/or the framework that you are using. As the OP is using Apache, they can find great documentation on the Apache module mod_expires to figure out how to tweak caching for their site.

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

Sidebar

Related Questions

Is there any way to force a browser to refresh or empty it's cache,
Is there some way to cache a generated report in the reporting services, so
Is there a way to cache per-request data in Rails? For a given Rails/mongrel
Is there a simple way to cache MySQL queries in PHP or failing that,
Is there an easy way to cache things when using urllib2 that I am
Is there a way to look through the cache for all objects in the
Is there a way to monitor the size of the cache on your web
Rails caches (file cache) per default domain-based, but is there a way to disable
We are using APC as an opcode cache. Is there a way to get
Is there any way I can rename this CSS code to only affect 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.