I currently have an array with lots of image URLs called `images` They are being put into my table like this:

```
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *simpleTableIdentifier = @"SimpleTableCell";

    SimpleTableCell *cell = (SimpleTableCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
    if (cell == nil)
    {
        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SimpleTableCell" owner:self options:nil];
        cell = [nib objectAtIndex:0];
    }

    NSLog(@"indexPath.row=%ld", (long)indexPath.row);
    NSLog(@"images[indexPath.row]=%@", [images objectAtIndex:indexPath.row]);

    NSString *stringy = @"http://www.tragicclothing.co.uk/";
    NSString *link = [stringy stringByAppendingString: images[indexPath.row]];
    NSString* encodedString = [link stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    NSData * imageData = [[NSData alloc] initWithContentsOfURL: [NSURL URLWithString:encodedString]];
    cell.thumbnailImageView.image = [UIImage imageWithData: imageData];
    cell.backgroundColor = [UIColor clearColor];
    cell.opaque = NO;
    cell.backgroundView = nil;

    return cell;
}

```

But this is causing a lot of lag when scrolling. How could I cache the data? to prevent this lag? I have seen [SDWebImage](https://github.com/rs/SDWebImage) but I don't quite know how to use it! It seems very complicated.

Should I be using

```
SDImageCache *imageCache = [[SDImageCache alloc] initWithNamespace:@"myNamespace"];
[imageCache queryDiskCacheForKey:myCacheKey done:^(UIImage *image)
{
    // image is not nil if image was found
}];

```