Ignore URL parameters when caching in Symfony

Most of my new sites I run are running on top of the Symfony framework.  One small annoyance I run into is when caching pages, it will create a new cached file for a URL which includes a parameter that doesn’t affect which page is returned.

For example, on my flash game sites when I sponsor games I use URL parameters to track where traffic is coming from when people click my in game logos/links.  This creates a huge number of cache files that are really useless, as they contain the same info.  This slows down my page load as well, as it essentially ignores my cache and creates a new version each time if someone comes to my site from one of those logos.

I found a blog post by someone who has fixed this issue.  This is a perfect fix for this issue, and I thought I would share the link.

Check it out here: http://www.pyrkosz.pl/Symfony_Ignore_unused_GET_parameters_for_caching.html

Be Sociable, Share!

Comments are closed.