Squiz Caching problem


(Paul Marsden) #1

Hello All,

 

I’d like some advice on Matrix Caching please! I’ve only been using Squiz for a couple of weeks so please forgive me if I’ve missed something obvious.

 

I have a page on my website where the user makes a selection and a cookie is set. I am reading this cookie using the %globals_cookie_cookiename% variable.  I’m using the value of this cookie variable to do two things – output directly in a textarea and as a dynamic event source in an event listing (so I have a Replace Event Source > Set Value > %globals_cookie_cookiename%). These two elements (text and event list) are displaying on every page of the website. This is all working as expected. However (!), in some browsers the value of the cookie variable is not being reflected in the event listing until the _nocache suffix (or a control F5) is used (obviously only on previously visited pages).  I want to tell squiz not to cache these assets and always read them directly from the server.

 

To test this I’ve tried two things:

  1. I’ve gone into Cache Manager and basically tried to turn it off for everything (just to prove that stopping squiz caching will solve this). I have caching status set to off and cache expiry set to 0 and all cache levels set to off and the cachable root URL crossed out. This hasn’t helped.  
  2. I’ve created a trigger of Asset Accessed > Condition of my cookie asset being accessed > Action of Clear Matrix Cache (Ignore Permissions, Include Current Asset, Asset ID of my event listing). I’ve also set this for Clear Squid Cache too. This didn’t work. I then added the site root asset ID to be cleared too but alas, as you’ve probably guessed by now, it didn’t work.

 

Basically I need to be able to:

  1. Switch off any caching of a particular assetID (so that my event list always reads fresh from the server)

    OR
     
  2. Actively deny caching altogether

    OR
     
  3. Set a trigger saying that when my Cookie asset is accessed then do a _nocache for that user on all pages on the site in their browser cache.

 

Firefox, naturally, is behaving perfectly. IE, naturally, is being a pain. Surprisingly, Safari and Chrome are also partly misbehaving.

 

Any ideas are gratefully received.

 

Thanks

Paul


(Aleks Bochniak) #2

Are you using ajax to load content into the page?


(Paul Marsden) #3

Hi Aleks,  

No, this is just an Events List asset using %globals_cookie_cookiename% as the value for a Dynamic Event Source and then the output contains straightforward variables like asset_metadata_EventVenue and event_start_datetime etc...

Thanks
Paul


(Nic Hubbard) #4

In the Cache Manager, you can go to the Root Node Specific screen and turn caching off for specific assets. Not sure if this will help though.


(Bart Banda) #5

In the Cache Manager, you can go to the Root Node Specific screen and turn caching off for specific assets. Not sure if this will help though.

Yea I would do that, turn off caching completely for the listing asset. Remember that even though you might be bypassing matrix and Squid cache, you can still view the page via the browser cache. So I would either turn off caching completely via the method Nic suggests, or load the listing in via AJAX with a _nocache URL. 


(Paul Marsden) #6

Thanks for the advice. I shall try these ideas and report back.