Jump to content


Photo
- - - - -

Anti-cache hash should change on edit or re-cache.


  • Please log in to reply
4 replies to this topic

#1 alexp999

alexp999

    Advanced Member

  • Visitors
  • PipPipPipPip
  • 291 posts

Posted 05 August 2012 - 07:20 AM

I opened a support ticket after I found that CSS changes weren't visible on my site, despite there being an anti-cache hash.

It seemed as though the hash was not changing even after re-caching the skin set, so I dug into the output class and found the following:

$this->antiCacheHash = md5( IPB_VERSION . $this->settings['board_url'] . md5( $this->settings['sql_tbl_prefix'] . $this->settings['sql_pass'] ) );

Which means that its fairly pointless, as it will only realistically change when the site owner updates their board.

The hash should change whenever the skin is updated. I had a look through the core caches, and we already have a cache entry for each skin in "skinsets" under "set_updated".

I would imagine its a very simple change, that requires no extra queries, to have the timestamp of when the skin was last updated added to the hash, then whenever someone edits their skin files, changes will be reflected straight away as the hash will change.

#2 AutoItScript

AutoItScript

    IPB Member

  • +Clients
  • 69 posts

Posted 08 August 2012 - 04:11 AM

I opened a support ticket after I found that CSS changes weren't visible on my site, despite there being an anti-cache hash.

It seemed as though the hash was not changing even after re-caching the skin set, so I dug into the output class and found the following:

$this->antiCacheHash = md5( IPB_VERSION . $this->settings['board_url'] . md5( $this->settings['sql_tbl_prefix'] . $this->settings['sql_pass'] ) );

Which means that its fairly pointless, as it will only realistically change when the site owner updates their board.

The hash should change whenever the skin is updated. I had a look through the core caches, and we already have a cache entry for each skin in "skinsets" under "set_updated".

I would imagine its a very simple change, that requires no extra queries, to have the timestamp of when the skin was last updated added to the hash, then whenever someone edits their skin files, changes will be reflected straight away as the hash will change.


Did you get a fix for this? I've got the same issue.

Edited by AutoItScript, 08 August 2012 - 04:12 AM.


#3 alexp999

alexp999

    Advanced Member

  • Visitors
  • PipPipPipPip
  • 291 posts

Posted 08 August 2012 - 05:10 AM

The only fix until its included in a future release will either be a code modification or hook.

I was hoping me might get some input from IPS on it too, but I think I will have to look into writing my own hook for now.

#4 alexp999

alexp999

    Advanced Member

  • Visitors
  • PipPipPipPip
  • 291 posts

Posted 09 August 2012 - 08:27 AM

Made a free hook you can use, until this becomes part of IPB:




Alex.

#5 alexp999

alexp999

    Advanced Member

  • Visitors
  • PipPipPipPip
  • 291 posts

Posted 14 December 2012 - 04:27 PM

For anyone coming across this later on, I'm pleased to say my hook is not needed for IPB 3.4.x, as IPS have implemented this fix themselves :)






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users