[eluser]DisgruntledGoat[/eluser]
I'm using CI's caching tools. On several pages, I decided to remove a bunch of images (they were CSS-sprited but still over 300K in size) and let the user decide if they wanted to show them, via Javascript.
Then I thought it would be neat to allow the user to keep images displayed across the various pages to avoid repeated clicking of "display images" (and especially since the images would be cached in their browser once loaded). So now it's an option of "images off" (default) or "images on".
I'm using a cookie to store the user preference, but this means I can't serve a cached version of the page because it will be different for half the visitors. Can I cache two versions of the file, and serve a different one based if the cookie is present?
I am currently using a Javascript solution that checks for the cookie via JS and loads images. But I'm hoping for a server-side solution if possible.