<commit_before>//
//  Request+Cache.swift
//  VimeoNetworkingExample-iOS
//
//  Created by <NAME> on 4/14/16.
//  Copyright © 2016 Vimeo. All rights reserved.
//

import Foundation

public extension Request
{
        /// Generates a unique cache key for a request, taking into account endpoint and parameters
    var cacheKey: String
    {
        var cacheKey = self.path
        
        for (key, value) in self.parameters
        {
            cacheKey += key
            cacheKey += value.description
        }
        
        cacheKey = cacheKey.stringByReplacingOccurrencesOfString("/", withString: ".")
        
        return cacheKey
    }
}<commit_msg>updating cache key logic to deal with huge field filtering params issue<commit_after>//
//  Request+Cache.swift
//  VimeoNetworkingExample-iOS
//
//  Created by <NAME> on 4/14/16.
//  Copyright © 2016 Vimeo. All rights reserved.
//

import Foundation

public extension Request
{
        /// Generates a unique cache key for a request, taking into account endpoint and parameters
    var cacheKey: String
    {
        var cacheKey = "cached" + self.path
        
        for (key, value) in self.parameters
        {
            if key == "fields"
            {
                // avoiding the field filtering key due to excessive length
                continue
            }
            
            cacheKey += key
            cacheKey += value.description
        }
        
        cacheKey = cacheKey.stringByReplacingOccurrencesOfString("/", withString: ".")
        
        return cacheKey
    }
}
{'fraction_non_alphanumeric': 0.08598726114649681, 'fraction_numerical': 0.011464968152866241, 'mean_word_length': 1.7756183745583038, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3626264', 'n_tokens_mistral': 438, 'n_tokens_neox': 410, 'n_words': 133}