Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6942519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:01:50+00:00 2026-05-27T13:01:50+00:00

I am currently receiving some compressed data from my server. I would like to

  • 0

I am currently receiving some compressed data from my server.
I would like to know if there is a way to check how much bandwidth is being saved but checking the size of the compressed data vs the uncompressed data?

This is what my code looks like

//Communication Test
- (IBAction)sendHttpsRequest
{   
    //Start HUD
    [SVProgressHUD showWithMaskType:SVProgressHUDMaskTypeBlack];
    [SVProgressHUD setStatus:@"loading..."];

    //Set request address
    NSMutableString *databaseURL = [[NSMutableString alloc] initWithString:@"https://192.168.17.36:443"];

    //call ASIHTTP delegates (Used to connect to database)
    NSURL *url = [NSURL URLWithString:databaseURL];

    //This sets up all other request
    ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url];

    [request setDelegate:self];
    [request setValidatesSecureCertificate:NO];
    [request setPostValue:@"ClientDataSet.xml" forKey:@"filename"];  

    [request startSynchronous];

    BOOL dataWasCompressed = [request isResponseCompressed]; // Was the response gzip compressed?
    NSData *compressedResponse = [request rawResponseData]; // Compressed data
    NSData *uncompressedData = [request responseData]; // Uncompressed data
    NSString *response = [request responseString]; // Uncompressed data as a string

    //Output responses    
    NSLog(@"compressed? %@", dataWasCompressed ? @"YES" : @"NO" );
    NSLog(@"compressed Response = %@", compressedResponse);
    NSLog(@"uncompressed Data = %@", uncompressedData);
    NSLog(@"response = %@", response);
}

- (void)requestFinished:(ASIHTTPRequest *)request
{       
    self.hudCheck = YES;

    responseString = [request responseString]; //Pass requested text from server over to NSString
    NSLog(@"Response String = %@", responseString);

    //removies the SVProgressHUD
    [NSTimer scheduledTimerWithTimeInterval:0.25 target:self selector:@selector(stopAnimating) userInfo:nil repeats:NO];
}

Any help would be greatly appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:01:51+00:00Added an answer on May 27, 2026 at 1:01 pm

    METHOD 1: Since ASIHttpRequest uses gzip to uncompress data, one easy way to see the compression rate is to just use gzip on your server & see how small the file becomes.

    In normal scenario i.e. when gzipping text files, gzip gives close to 80% compression rates.

    METHOD 2: If you require exact amount of compressed data transferred over the air then you need to implement request:didReceiveBytes: and request:incrementDownloadSizeBy:. Both are download trackers in ASIHttpRequest primarily used for showing download progress bars.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the preferred/easiest way to find the control that is currently receiving user
Currently I'm doing some unit tests which are executed from bash. Unit tests are
I just would like to know how can I dynamically change a label's values
I am working with some code that uses an OleDbConnection to load data from
I'm trying to make motion controller using the values from android sensors. Currently sending/receiving
I have a separate thread that listens for data. And on receiving some data
I'm currently clipping some UIViews within a parent view like in the illustration below:
I am currently receiving this error: Validation of viewstate MAC failed. If this application
I am currently sending and receiving SIP messages across a network. When I want
Currently we have a hybrid ASP/PHP setup connecting to a SQL Server 2005 database.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.