nloding Posted October 14, 2007 Share Posted October 14, 2007 So I was looking over Facebook's website to see how they implemented a few things, and all the links are littered with numbers following the file extension. Some are understandable, for normal PHP uses (searches, profile id, whatever). Some are bizarre, such as these: <img src="http://static.ak.facebook.com/images/global_menu_space.gif?12:37897" align="top" /> <script type="text/javascript" src="http://static.ak.facebook.com/js/vector.js?12:61586"></script> <link rel="stylesheet" href="http://static.ak.facebook.com/css/attachments.css?12:59060" type="text/css"/> What is the purpose of having that info after the filename? I'm lost, I can't find anything about this! I've seen it everywhere too, like in the Wordpress javascript includes. This is the only time I've seen it on an img tag though. Quote Link to comment Share on other sites More sharing options...
mainewoods Posted October 14, 2007 Share Posted October 14, 2007 there are 2 ways they can be using those. The first is just to put some extra info into their server logs about from which page the request came from. The extra stuff on the end of the .gif will cause no graphic loading problem so it can be a simple way to get extra info in your logs. The other way they could be using that could be termed : When is a .css file not a .css file? The answer to that is when you use the .htaccess file in apache to make an arbitrary file extension of your choice now be parsed and executed as a .php file! For instance you could make a '.cat' file run as a .php file, or even the .css files. That way the .css file could process url parameters, set or retrieve cookies, and access databases. It would still have to return a file in .css format, but parts of that .css file could be altered based on info gathered server side, like maybe the current users page style preferences. Quote Link to comment Share on other sites More sharing options...
fenway Posted October 15, 2007 Share Posted October 15, 2007 Also useful for caching. Quote Link to comment Share on other sites More sharing options...
mainewoods Posted October 15, 2007 Share Posted October 15, 2007 <img src="http://static.ak.facebook.com/images/global_menu_space.gif?11:11111" align="top" /> <img src="http://static.ak.facebook.com/images/global_menu_space.gif?12:37897" align="top" /> How is that useful for caching fenway? For instance, wouldn't the 2 images above be treated as 2 different images by caches only because the numbers after the '.gif?' are different even though the graphics are the same? Wouldn't that cause the images to not be cached? Quote Link to comment Share on other sites More sharing options...
fenway Posted October 16, 2007 Share Posted October 16, 2007 <img src="http://static.ak.facebook.com/images/global_menu_space.gif?11:11111" align="top" /> <img src="http://static.ak.facebook.com/images/global_menu_space.gif?12:37897" align="top" /> How is that useful for caching fenway? For instance, wouldn't the 2 images above be treated as 2 different images by caches only because the numbers after the '.gif?' are different even though the graphics are the same? Wouldn't that cause the images to not be cached? Sorry, I meant useful for preventing caching... obviously, in this case, that's not what they want, but I've appended timestamp to src tags regularly. Quote Link to comment Share on other sites More sharing options...
mainewoods Posted October 16, 2007 Share Posted October 16, 2007 ya, they're probably using those numbers to track the surfers of the site. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.