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 8624395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T07:31:12+00:00 2026-06-12T07:31:12+00:00

We are building an iOS app that uses AFNetworking to connect to a server

  • 0

We are building an iOS app that uses AFNetworking to connect to a server running Tornado. The server includes the header Cache-Control: private, max-age=900 in the response. When running the server on my local machine, I can tell that AFNetworking uses the cached values because there are no requests received by the server on repeated requests from the app. When we deploy the same Tornado server to the test machine, each request from the app results in a request received on the server, ignoring the cached value.

The only difference between the two setups are the URL of the server and the fact that the test server is accessed over a HTTPS connection, while the localhost uses HTTP. Does HTTPS affect the caching by AFNetworking, and if so, how can we get AFNetworking to respect the cache header?

  • 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-06-12T07:31:13+00:00Added an answer on June 12, 2026 at 7:31 am

    Not sure if its gonna be any help but here it is anyway:
    AFNetworking uses NSURLConnection which uses NSURLCache shared cache. AFNetworking absolutely transparent in cache regard and doesn’t do anything specific.
    My requests are https and were caching just fine.

    Cache-Control response directives allow an origin server to override the default cacheability of a response:
    private
    Indicates that all or part of the response message is intended for a single user and MUST NOT be cached by a shared cache. This allows an origin server to state that the specified parts of the
    response are intended for only one user and are not a valid response for requests by other users. A private (non-shared) cache MAY cache the response.
    http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9.1

    If acceptable try to change policy to public .
    Log headers on response from the app and look at your cache.db and see if in fact something is caching there.

    Try to configure shared cache – something along the lines of

    int cacheSizeMemory = 1*1024*1024; // 4MB
    int cacheSizeDisk = 100*1024*1024; // 100MB
    [[NSURLCache sharedURLCache] setMemoryCapacity:cacheSizeMemory];
    [[NSURLCache sharedURLCache] setDiskCapacity:cacheSizeDisk];
    

    Another good read about this here
    http://petersteinberger.com/blog/2012/nsurlcache-uses-a-disk-cache-as-of-ios5/

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

Sidebar

Related Questions

I am building an assistive iOS app for a kid that uses a switch
I am currently building an iOS app that uses Kosmaczewski's Objective-C REST client/wrapper to
Some Quick Background I'm building an iOS app that uses html web views in
I am building an IOS 5.1 web client app that uses a storyboard. One
I'm building an iOS app that uses push notifications, and I'm finally ready to
I am building a universal app that uses a UISplitViewController for the iPad, and
We are building a PhoneGap app (both for iOS and Android) that has a
We're building an app that only targets iOS 5. When declaring properties of primitive
I'm building a native iOS app that will allow end users to build forms
I'm diving into iOS development and I'm building a navigation based app that wasn't

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.