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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:05:52+00:00 2026-05-16T02:05:52+00:00

WCF Restful Webservice seems to be caching the LINQ data objects somehow. The webservice

  • 0

WCF Restful Webservice seems to be caching the LINQ data objects somehow.

The webservice is a WCF Restful Service build on .NET 4.0 and is currently running in my local ASP.net Dev Server.

I have a MSSQL 2008 database which contains a range of valid IP addresses which the webservice uses LINQ to validate against. The mechanism that validates the client IP against the acceptable IP range from the DB works successfully as independently tested.

SCENARIO:
client IP is 127.0.0.1
valid IP range is: 127.0.0.0 to 127.0.0.5

I perform a GET request from Fiddler to the webservice and it works as it should, by giving me back a nice 200 status code. I then change the range in the DB to be 127.0.0.0 to 127.0.0.0 and still receive a 200 status code when I should be receiving a 401 status code. I then go to Visual Studio and simply save a file (without any modifications) and return to Fiddler and reissue the request and I now get the desired 401 status code.

In the web service I am setting the Cache-Control and Pragma headers to “no-cache” which is present in the response:

HTTP/1.1 200 OK
Server: ASP.NET Development Server/10.0.0.0
Date: Fri, 30 Jul 2010 16:12:56 GMT
X-AspNet-Version: 4.0.30319
Pragma: no-cache
Content-Length: 1121680
Cache-Control: no-cache
Content-Type: application/xml; charset=utf-8
Connection: Close

or..

HTTP/1.1 401 Unauthorized
Server: ASP.NET Development Server/10.0.0.0
Date: Fri, 30 Jul 2010 16:26:48 GMT
X-AspNet-Version: 4.0.30319
Pragma: no-cache
Content-Length: 88
Cache-Control: no-cache
Content-Type: application/xml; charset=utf-8
Connection: Close

It seems to me that something in the LINQ process is caching the data that it originally got back from the first request and is not returning to the DB for each subsequent request. Once I save any file on the webservice, it causes recompilation of the service and thus performs another lookup to get the data.

  • 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-16T02:05:52+00:00Added an answer on May 16, 2026 at 2:05 am

    Are you able to test your LINQ-to-SQL call directly, without going through the web service, just to verify that LINQ-to-SQL may be performing caching for you?

    Also, here’s a link to an issue that’s similar to yours, and requires that you disable object tracking. The default value of this property on your data context is true. The relevant section of the post:

    Your solution is to disable object
    tracking (caching for LINQ) of the
    data context like so.
    myContext.ObjectTrackingEnabled = false;

    Hope this helps!

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

Sidebar

Related Questions

I have wirtten a RESTful WCF Service. Incorporating E-Tags, expires headers. The caching works
I've got some RESTful services running in a pure WCF context (i.e. ASP.NET compatibility
I just noticed while creating a RESTful WCF service that the Method parameter on
Using WCF in a RESTful way seems great. I’m a big fan of the
I have a RESTful service that I am developing in WCF . I am
My WCF service involves the sending of a dataset (in csv format) data between
I'm trying to consume a RESTful web service using WCF. I have no control
In my knowledge, the RESTful WCF still has .svc in its URL. For example,
WCF is Microsoft's replacement for .Net Remoting and Web services. It's critical to understand
My WCF Service uses wsHttpBinding and works fine from the client when the service

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.