alexp999

(tng33) Improved Anti Cache Hash

8 posts in this topic

File Name: (tng33) Improved Anti Cache Hash

File Submitter: alexp999

File Submitted: 08 Aug 2012

File Category: Performance

Supported Versions: IP.Board 3.3.x



Exactly as the title says, this hook aims to improve upon the "Anti-Cache Hash" which IP.Board now has to try and stop web browsers caching old CSS and javascript files.

IP.Board's default implementation will only ever realistically change the hash when upgrading to a new version of IP.Board. This is not ideal, especially when you make changes to your skins as the changes will not be reflected without everyone who visits your site, first clearing their browser cache.

What this very lightweight and simple hook does, is replace all instances of the hash with another one (based on the original hash), but it will change based on the timestamp of when the skin the user is viewing was last updated.

You may find you need to re-cache the skin after editing it, to force the timestamp to update if you do not see your CSS changes straight away.

Basically, if you are having issues with CSS changes not making it to your users without them clearing their browser cache, give this hook a try and get behind our feedback thread for getting something like this added to a future IP.Board release:



IPB 3.4.x

I'm pleased to say this is not needed for IPB 3.4.x, as IPS have implemented this fix themselves :smile:



here to download this file

Share this post


Link to post
Share on other sites

Im using this hook on my own site and its working a treat. Fixes the issue I was having with CDN caching.

Of course if you want an unbias review you may have to wait a little longer.

Its a very simple hook so shouldnt cause any issues but I am happy to help with any problems you may have.

Share this post


Link to post
Share on other sites

I was wondering if it work for Images of IPBoard skin too? I notice with IPBoard skin everytime I changed the image of the skin or banner background, it does not reflect the change unless the user clear their Browser cache, which is not very ideal.

Share this post


Link to post
Share on other sites

I was wondering if it work for Images of IPBoard skin too? I notice with IPBoard skin everytime I changed the image of the skin or banner background, it does not reflect the change unless the user clear their Browser cache, which is not very ideal.

No it doesn't. This is now the default in IPB.

When you replace a image you should rename it or add file.jpg?12123123

Rename is better.

Share this post


Link to post
Share on other sites

I was wondering if it work for Images of IPBoard skin too? I notice with IPBoard skin everytime I changed the image of the skin or banner background, it does not reflect the change unless the user clear their Browser cache, which is not very ideal.

I usually just rename the image set folder in style_images and update the skin settings to reflect that.

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.