PHP, JS, Cookies n Cache




The challenge I had was that all pages are cached server side from top to bottom - having a different header was the challenge. This is how I went about tacking the problem...
First, the "Display old/new header" calls some JS which saves a cookie with your preferred header type - the page is then refreshed to display the header you chose and you will see that header until somebody eats your cookie.
When the page loads, the PHP script will then check the cookie saved by the JS script and depending on your header preference, the server side cache id is given a different name. This means that there are two different caches available for the top page.
I also had to make sure that a searchbot does not index two different versions of the same page which is why I chose JS to make the switching as searchbots dont follow links in JS (yet...).
Now that I know how to do this, I will be preparing other experimental header design changes and options too like a gundam header for example.
I'm also doing some tweaks here and there and must apologize to IE users as I have pretty much given up spending hours implementing hacks just so that CSS renders correctly. I will continue to try to make sure things are functional though (tears).
You may have noticed many other tweaks over the site – you may want to do a force refresh of your browser cache using CTR L+ refresh.
What I will also get to one day (but low priority right now) is to let you turn on/off (or at least reduce) the stuff that you see on the left and right columns too.
If you are interested in reading about life in Japan, seeing photos taken daily around Tokyo, like Japanese subculture (anime, manga, figures, Dollfies) then you may want to start delving into the Japan or Figure categories for a start or have a gander at all photo articles.
If you don't have much time now, maybe subscribe to the RSS Feed, Twitter Feed or join the other readers in the FaceBook Page.
Alternatively, you may want to read more about the site.
If you are a regular reader then this message will probably annoy you each time - hide it forever.
-Akihabara News – Gadgetry from Japan (Subscribe)


















