Jump to content

Page caching issues with htaccess.


loccom

Recommended Posts

Hi guys

I have been adding Expires Caching in to my htaccess files. But now think i have done it wrong.

I am now getting topic titles in the sidebar not updating unless i refresh the page. How can i let the page posts update more often?

here is my code

 

## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType application/x-shockwave-flash "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
ExpiresByType text/css "now plus 1 week"
ExpiresByType application/javascript "now plus 1 week"
ExpiresByType application/x-javascript "now plus 1 week"
</IfModule>
## EXPIRES CACHING ##

 

Link to comment
Share on other sites

1 minute ago, loccom said:

I am now getting topic titles in the sidebar not updating unless i refresh the page.

That’s normal on any IPS page. You can lower the sidebar cache time in the ACP if you want it to update more often – after reload that is – sidebar blocks are not updated automatically. 

Link to comment
Share on other sites

Nothing in that file affects the sidebar directly. So there might be some other problems here. The sidebar is generated by the software on page load. It’s not like it’s a single file the browser pulls from the server. It would help if you would post your site, your block settings – what and what should not appear there –, maybe your cache settings and things like that. 

Regarding your htaccess rules: That ExpiresDefault could cause problems. I would not use that. You are setting EVERYTHING to cache for 2 days, where no other rule applies. I wouldn’t put something like that in the root folder. (In fact, I don’t put any cache rules in the root, but in the directories where I need them.)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...