MyBB Community Forums

Full Version: Leverage browser caching HELP
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Guys I need you help when I enable Leverage browser caching I have problems with login and logout also forum posts threads don't get updated I need to hard refresh in order to see new posts!

I have these options
HTML
CSS
Script
Images


Which of them I are causing this problem?
I'm guessing you're applying the cache rules to every request, you should only send the cache headers for static content (In MyBB's case, just images, CSS and JS).

Take a look through H5PB's htaccess performance section (in particular the expires headers) to get an idea of things you should be caching: https://github.com/h5bp/server-configs-a...ccess#L468
Please help me to properly configure this stuff I would very appreciate your help!
Currently I am only catching images because of the issue describe above! I have checked and this forum uses browser caching and has no problem please guys help me to properly configure MYBB forum for browser caching
Thanks

@CameronBig Grin could you please help me out with this stuff I am going no where with this

Will this code work fine with MYBB
Quote:<IfModule mod_expires.c>

ExpiresActive on
ExpiresDefault "access plus 1 month"

# CSS
ExpiresByType text/css "access plus 1 year"

# Data interchange
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"

# Favicon (cannot be renamed!) and cursor images
ExpiresByType image/x-icon "access plus 1 week"

# HTML components (HTCs)
ExpiresByType text/x-component "access plus 1 month"

# HTML
ExpiresByType text/html "access plus 0 seconds"

# JavaScript
ExpiresByType application/javascript "access plus 1 year"

# Manifest files
ExpiresByType application/x-web-app-manifest+json "access plus 0 seconds"
ExpiresByType text/cache-manifest "access plus 0 seconds"

# Media
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"

# Web feeds
ExpiresByType application/atom+xml "access plus 1 hour"
ExpiresByType application/rss+xml "access plus 1 hour"

# Web fonts
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"

</IfModule>
This board is for MyBB support
(11-24-2013, 11:49 AM)Stefan C. Wrote: [ -> ]This board is for MyBB support

Yes thanks for reminding me. I am using MYBB forum script and I need support with this pretty basic stuff Smile
(11-24-2013, 11:04 AM)marcus123 Wrote: [ -> ]@CameronBig Grin could you please help me out with this stuff I am going no where with this

Will this code work fine with MYBB

Most of the rules in the full file I linked won't be necessary, for MyBB you'll probably only need the following (as it doesn't use custom fonts/HTML manifests):
<IfModule mod_expires.c>
    ExpiresActive on
    #To be safe we'll set anything not covered elsewhere to cache for only a day
    ExpiresDefault "access plus 1 day"

    #MyBB does not use a ?querystring for the CSS, so it will take this long for users to see the changes to the CSS
    ExpiresByType text/css "access plus 2 days" 

    # This is the important one, will stop your actual pages being cached
    ExpiresByType text/html "access plus 0 seconds"

    # MyBB used a ?querystring for javascript so a long expiry is fine
    ExpiresByType application/javascript "access plus 1 month"

    # Images! If you change an image it will take this long for users to see the change
    # unless you add/change the ?querystring for them
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
</IfModule>

If you don't use the unset ETag lines then your CSS changes *should* be immediate, but I'm not entirely sure.

For my own site I've set CSS and Javascript to both expire after a year then I use the snippet of code for versioning files along with an edit to the MyBB core files to apply that to the CSS file.
CSS set to expire after 2 days what will happen if I make some modifications to CSS
(11-24-2013, 11:54 AM)marcus123 Wrote: [ -> ]
(11-24-2013, 11:49 AM)Stefan C. Wrote: [ -> ]This board is for MyBB support

Yes thanks for reminding me. I am using MYBB forum script and I need support with this pretty basic stuff Smile

Alright, but this thread has absolutely nothing to do with MyBB support. It has to do with an Apache extension. That's like trying to ask for support on how to install apache, or mysql, or php.. Completely irrelevant to the forum category.
This forum is to support stuff related to MYBB so everything from PHP, HTML, JavaScript to the server I mean you name it can be posted here as long as you have MYBB copy.
At least I think so
"General support for the MyBB 1.6 series." not "General support for any random thing as long as you install MyBB."
Pages: 1 2