The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Cache buttons etc images
Is there a way of caching only some groups of images and not all of them?
E.g. I want the browser to use its cache for buttons, IM images, smilies (maybe and some other groups of images that don't change in every visit) but I don't want it to use the cache for status icons and the rest of the images that may have changed from the previous time that a user visited the forum. Sinse some group of images don't change (while other change in every visit of a member in the forum) is there a way to do it? I asked this in vb.com and Steve said that he is not sure this is even possible but if so it requires modifying the code. Do you think is it possible to achieve something like this? Is there something like this available, or could someone point me in the right direction so I can make a hack for this? |
#2
|
||||
|
||||
That doesn't make sense at all, as the images never change (except if you upload new ones).
But if you really want to do that put this as .htaccess in the appropriate directory Code:
ExpiresActive On ExpiresDefault A0 Header unset Cache-Control Header append Cache-Control "no-cache, must-revalidate" |
#3
|
|||
|
|||
Thanks for the answer but as I posted in vb.com (I saw the answer there first):
Quote:
Oops! I just noticed this! Quote:
If so, should I put this in the directory of the images that I want to be cached or in the directory of the images that I want to not be cached? |
#4
|
||||
|
||||
Quote:
But as I already said, the images "never" change. What actually does change are the image URLs within the HTML that is being generated by vBulletin (eg. <img src="...statusicon/post_new.gif" ...> and <img src="...statusicon/post_old.gif" ...> for example) If you see wrong images, you most likely have problems with a (faulty) proxy. To get around this, you would have to disable caching: ACP / vBulletin Options / Cookies and HTTP Header Options / [X] User No-Cache Headers However, this might/will increase bandwidth usage and server load. |
#5
|
|||
|
|||
I currently use the No-cache option.
I saw in the vb.com that it is recommented to use no-cache so the members always get the most fresh contents without caching problems. I just would like to use the cache for the images that don't change neighter their URLs as you said. |
#6
|
||||
|
||||
Then you don't have to do anything, the browser will cache the images (at least it should IIRC).
|
#7
|
|||
|
|||
No, my browser always fetches the images from the site (both IE and FF configured to use cache).
Since I have the "User No-Cache Headers = YES" isn't it the way that the browser should work? I mean, I have set "User No-Cache Headers = YES" to not-cache anything from the site, so the browser does just that. Am I missing something? |
#8
|
||||
|
||||
Hmm, I do have Use No-Cache Headers set to Yes, but Firefox uses the Cache for images.
Try the following with Firefox: Clear the Cache, close all Firefox instances. Open LiveHTTPHeaders. Visit some forums/threads at your board, then attach the LiveHTTPHeaders Log here. Attention This Log does contain cookie information, you must strip the cookies bbsessionhash and bbpassword first |
#9
|
|||
|
|||
Quote:
I tried the same with IE, but with no luck. (Even here, IE always fetched the images from the site.) I guess I have to check this, with some of my members to see how their IE is working. I made some testing with both FF and IE in my forum. FF works just fine now. But IE still refuses to use the cache... to be more specific: it uses the cache for the images of the previous page that I was viewing and not for any other image. E.g. if I press "Post Reply" it shows immediatly the smilies that was in the thread's page that I was viewing, but not the rest of the smilies. Is this normal? (I just downloaded LiveHTTPHeaders. Do you still think that it would help to paste a log here?) Thanks again. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|