• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.1 Caching style elements

Jeff Fuqua

Well-known member
#1
I'm attempting to speed up my site and see that many of my style elements are recommended for longer caching because they have a "short freshness lifetime". Is there a way to specify an expiration of a week or more somewhere in the admin? Thanks.
 

DBA

Well-known member
#2
I'm attempting to speed up my site and see that many of my style elements are recommended for longer caching because they have a "short freshness lifetime". Is there a way to specify an expiration of a week or more somewhere in the admin? Thanks.
Add something like this to your root .htaccess file (what I use on my site).

Code:
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4|css|js)$">
Header set Cache-Control "max-age=2592000, public, must-revalidate"
</FilesMatch>
 
#SetOutputFilter DEFLATE
AddOutputFilter DEFLATE xhtml html htm php css js xml xsl txt plain javascript x-javascript ico
 

Jeff Fuqua

Well-known member
#3
Thanks for your help. What does this do? I do have a number of images which change often on my site. But things like the menu bars, etc. would not.
 

DBA

Well-known member
#4
Top part controls the caching and the bottom part takes care of the compression.

If you wanted to you could technically set the cache for 1 year without any issues. Just make sure to rename your new images. For example your current header image is called logo.jpg, so next time you change it call it logo2.jpg or something else.
 

Jeff Fuqua

Well-known member
#7
Yes. I'm using xenporta which must have all news slider photos named slide.jpg.

I'll overlook that Colts comment since you are sharing knowledge with me. ;)
 

DBA

Well-known member
#8
Yes. I'm using zenporta which must have all news slider photos named slide.jpg.

I'll overlook that Colts comment since you are sharing knowledge with me. ;)
I'm not familiar with the news slider, could you please PM me the site link. I'm pretty sure that the images still have a unique name.

Yeah I actually don't care that much about football, I'm more of a motocross guy, however I'm still a Hoosier. Lol
 

Jeff Fuqua

Well-known member
#9
My site is under construction but it's gotitans.com/xf.

NewsSlider requires the attachment always be the same name. But the image is pulled from the thread so don't know how that would impact things.
 

DBA

Well-known member
#14
My site is under construction but it's gotitans.com/xf.

NewsSlider requires the attachment always be the same name. But the image is pulled from the thread so don't know how that would impact things.
Yorick confirmed what I thought happened with the news slider images, with them being uploaded they have an attachment ID appended to them. This would make them all unique. (y)

BTW the XF version of GT looks a LOT better/cleaner.