views:

64

answers:

2

Hi ,

am rendering around 3000 records ,

So row like Customer Profile edit

Customername , Action

 1  john          editimage  | Delete image
 2  john          editimage  | Delete image
 3  john          editimage  | Delete image
 4  john          editimage  | Delete image
 5  john          editimage  | Delete image
    ...
    ...
3000  john          editimage  | Delete image

So every time edit and delete images loading ,

chk this imagealt text

+1  A: 

You're getting 304 Not Modified HTTP responses because the server detected that your browser still has the images in the client-side cache, so the server instructed your browser to retrieve those images from that cache. If it were a 200 OK, that means the server sent the images over the network, which is not the case as shown in your Firebug Net tab.

stillstanding
Yes, but there are many requests already, usually it should request an element on the page only once.
aularon
Then you are saying , this image not loading from server location
Bharanikumar
304 Not Modified HTTP responses GOOD OR BAD...
Bharanikumar
304 Not Modified is good, because it means it doesn't got loaded again, instead it will be loaded from cache
jigfox
The server just sends a 304 Not Modified header. No data is being transferred from server to your browser, which is a good thing because that's only a few bytes compared to several that an actual image being transferred consumes bandwidth-wise.
stillstanding
@jigfox but it means that a request took place, a typical request is about 0.3 KB request headers and 0.3 KB response headers, while those GIF images (response body) are 0.3 KB. So no, a 3,000 `304 Not Modified` requests/responses are not okay.
aularon
You'd have to check if 3000+ requests were actually made. I rather doubt it, especially when an object is used multiple times on a page. There's no point in doing "was this changed? how about now? now? now?". The cacheing layer will check ONCE for each page, and then just send the same response headers farther up the chain. So it looks like 3000+ 304's came in, but only one request was made.
Marc B
A Web server will not respond with a 304 Not Modified header if the browser did not send an If-Modified-Since field in the HTTP request. The server will not issue a 304 whimsically.
stillstanding
+1  A: 

In your code don't do <img src..> but rather use a div with a css class that uses the image as a background image for the div. It would probably help quite a bit.

<style>
.editimage {width:20px; height: 20px; background-image:/path/to/image.gif}
</style>
...
<div class="editimage">&nbsp;</div>
Nir Levy
Bad that's a bad practice when it comes to accessibility, it's not a styling image, but a button on the page with action to do, it should be `<img src="/path/to/img.gif" alt="Edit" />`.
aularon
@aularon In this case, an image does not offer any content. It would be bad practice to use an image tag for something that does not add anything more than text would. A better idea would be to use an input button or an anchor tag with the image applied using CSS.
Dan Herbert
I mean the image would be put inside an `<a>` tag, the `<a>` tag will provide the functionality. Besides, using a css supplied image with no text is bad when talking about accessibility.
aularon
@aularon: They guy asked a simple question so I gave a simple answer. A page with 3000 list items is a bad idea (even without accessibility concerns) but life is hard and I am sure this guy has his limitations.. A css bg image is a dirty trick, I agree, but given the situation it might help.
Nir Levy
@Nir It's okay, I just wanted to point that out so he knows that doing this has those cons besides the pros you mentioned
aularon