locked
Issue with caching on details screen in Lightswitch RRS feed

  • Question

  • Hi!

    I have a lightswitch application(silverlight web application) with a details screen which i use to edit a object. I have a Odata webservice as datasource that uses sql procedures to save data. When i have edited and saved the object i close the screen. When i open the screen again it looks like the data has not been updated, however the table in the database has been updated and so has the corresponding object in the dataworkspace in lightswitch. I have to clear the cache in Internet Explorer to get the new data to show on the details screen.

    I used fiddler to analyze the communication with the webservice and i found out that on the screens with this problem the call to the webservice uses Caching Private while other similar screens that do work uses Caching no-cache. I don't know how to fix this and there is not alot of information on this issue on the web.

    Kind Regards


    Tuesday, June 30, 2015 11:28 AM

All replies

  • Hi BlackmesaShadow,

    Someone has the same problem, please try with the API for refreshing data in LightSwitch in Visual Studio 2013. We could update the entity after modified with the refresh() method in the API. And more information about this issue, please read following link.
    https://social.msdn.microsoft.com/Forums/vstudio/en-US/c0c79693-09ea-44ab-8c05-92e3fcc12054/ls2013-interesting-caching-observation-is-this-a-bug?forum=lightswitch

    Best Regards,
    Weiwei

    Wednesday, July 1, 2015 9:07 AM
    Moderator
  • Hi

    I have tried with that solution before but the problem is that the object is just an ordinary class with a getter no setter. It's not a visualcollection of objects, i don't have the refresh option. And also my problem is a bit more advanced the data on the screen does not get updated when i refresh the browser i have to clear the browser cache. And i'm not using a html5 client, i'm using the silverlight web application client.

    Kind Regards

    Friday, July 3, 2015 9:13 AM
  • Hi BlackmesaShadow,

    Which browser are you using? If you are using IE 10, please refer to below thread to solve this problem.
    https://social.msdn.microsoft.com/Forums/en-US/2dbb50dd-d5ef-4f3d-a2f1-35617087d927/lightswitch-2012-internet-explorer-10-hell-no-its-really-dangerous?forum=lightswitch

    You can also try other browsers, such as: Firefox, Chrome, etc, and check whether it has same issue.

    In addition, perhaps this feature is also helpful for you, you can give a vote here.
    https://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/6749698-we-need-a-command-to-clear-the-cache-in-lightswitc

    Best Regards,
    Weiwei

    Monday, July 6, 2015 8:29 AM
    Moderator
  • It seems the caching issue is back (at least for me).  Using IE11, if I update an AddEdit Screen in the html client the changes are not reflected on the view entity screen even though they are updated in the database.  I tried the refresh() api but it is not a refresh issue.  A hard browser refresh does not display the updated data.  The only way to see the updated data is to manually clear the browser cache via Internet Options > Delete browsing history.  This is totally unacceptable.  Does anyone have a solution?  Thanks.

    Update:

    If I use F12 dev tools > Network > Always Refresh from Server everything works fine and I get the no-cache response header.  Without this setting it gives an if-none-match header using what appears to be rowversion as the E-tag.  I verified that my current rowversion does not match the rowversion in the header, which should result in a refresh from server (right??).  What is going on here?

    Update 2:

    The problem occurs when using a RIA Service data source to hydrate the View Entity screen AND the RIA entity has a rowversion property.  If the RIA entity does not use a rowversion property, the E-tag includes all properties and correctly refreshes from server if any of the properties do not match.  This is not ideal to include all properties in the E-tag, but for some reason the rowversion property is not being updated when there is a change to the underlying LS entity.  The RIA rowversion property is getting its value from the underlying LS entity.  Hopefully this makes sense.

    Update 3:

    My issue was resolved by fixing an issue with the RIA service query.


    • Edited by Hessc Friday, March 4, 2016 4:30 PM
    Friday, March 4, 2016 7:07 AM