Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 06-04-2005, 08:44 PM
Gearloose Gearloose is offline
 
Join Date: Mar 2005
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 06-05-2005, 12:28 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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"
Please note that this requires Apache with mod_expires and mod_headers
Reply With Quote
  #3  
Old 06-05-2005, 12:47 AM
Gearloose Gearloose is offline
 
Join Date: Mar 2005
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks for the answer but as I posted in vb.com (I saw the answer there first):
Quote:
Let me clearify it:

The buttons are the same always for all the members.
BUT...
The statusicons are not as e.g. some thread could have the "No New Posts" icon now, but when I come back tommorow it could have the "New Posts" icon.

Is it clearer now what I mean?

So, I'd like to find a way to use the browser's cache for only those images who don't change from one visit to the next one.
If I'm not mistaken, I think your .htaccess solution that you gave above is not what I want.


Oops! I just noticed this!

Quote:
Originally Posted by KirbyDE
if you really want to do that put this as .htaccess in the appropriate directory
Do you mean, it is directory specific?
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?
Reply With Quote
  #4  
Old 06-05-2005, 12:59 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Gearloose
Do you mean, it is directory specific?
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?
Yes. You have to place this in the directory where you don't want images to be cached.

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.
Reply With Quote
  #5  
Old 06-05-2005, 01:06 AM
Gearloose Gearloose is offline
 
Join Date: Mar 2005
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 06-05-2005, 01:11 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Then you don't have to do anything, the browser will cache the images (at least it should IIRC).
Reply With Quote
  #7  
Old 06-05-2005, 01:17 AM
Gearloose Gearloose is offline
 
Join Date: Mar 2005
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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?
Reply With Quote
  #8  
Old 06-05-2005, 01:40 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #9  
Old 06-05-2005, 02:55 AM
Gearloose Gearloose is offline
 
Join Date: Mar 2005
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by KirbyDE
Hmm, I do have Use No-Cache Headers set to Yes, but Firefox uses the Cache for images.
I cleared the cache and now FF works as you said. (I don't know why it wasn't working that way before.)
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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:48 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04390 seconds
  • Memory Usage 2,244KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (9)post_thanks_box
  • (9)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (9)post_thanks_postbit_info
  • (9)postbit
  • (9)postbit_onlinestatus
  • (9)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete