Showing posts with label Cache. Show all posts
Showing posts with label Cache. Show all posts

Monday, March 11, 2024

Understanding In-Memory Caching in .NET Core with IMemoryCache Interface

1. In-Memory Caching in .NET Core:
- In-Memory Caching is used to provide faster response to incoming requests by retrieving data from cache rather than the original source.
- Data Caching allows retrieval of data from cache as long as it doesn't expire.

2. Terms Related to Caching:
- Cache Hit refers to the requested data being in the cache, while Cache Miss refers to the data not being in the cache.
- In the case of Cache Miss, data is fetched from the data source and written back into the cache.

3. In-Memory Cache in .NET Core:
- In .NET Core, data can be written to cache, read, or deleted using the IMemoryCache interface in the Microsoft.Extensions.Caching.Memory library.
- Various options such as AbsoluteExpiration, ExpirationTokens, Priority, Size, and SlidingExpiration can be used to manage the cache.

4. Usage in a Project:
- Memory Cache is enabled in the ConfigureServices method in the startup.cs class by adding services.AddMemoryCache().
- The IMemoryCache interface is injected in the related controller to use 'In-Memory Cache'.

Friday, April 18, 2014

How do I clear the Facebook Share's Cache?

Sometimes you have a new description, title or thumbnail image in your website. But when you share the website URL on Facebook, it may still using the old description/ title/ image that no longer exists.

In order to clearing the Facebook sharer cache, there are few different ways like using tinyurls or modifying the URL by adding query strings. Since Facebook considers each one as different URL this might be quick way to do it.

The best and preferred way is to use Facebook Debugger tool which is formerly known as URL Linter to clear fb cache of your website. Go to below link and Type your website's or article's URL there and click debug button..

http://developers.facebook.com/tools/debug

After doing this, re-share your website's link on Facebook. You can find that Facebook sharer displaying your latest content.

Hope this helps!!