First of all I've seen lot's of threads about restriction, but didn't find what I'm looking for.
So, my goal is to restrict the access for a specific node to anonymous users and when they try to enter that node, it will redirect them to the user/login page.
I was using Content Access module till now. It works like it should, but the problem is when this module is enabled, block caching is not working. As I know the Context module has the same issue.
I have one big menu block and without caching, the website is 4 times slower. When the Content Access module is disabled, the block is cached and the performance is great.
Let's say the url of the page is 'apple'.
I'm looking for a way to restrict only this page programmatically, without breaking the block caching.
I'm using Drupal 7.