1 Replies - 656 Views - Last Post: 10 October 2014 - 04:35 AM

#1 missy786   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 22-September 14

Understand 304 response - not modified?

Posted 10 October 2014 - 04:26 AM

I am running the following script on the client-side and the script is failing to update, when there is change in the database. I debugged the script using DevTools and discovered my Jquery scripts are responding back as "304 not modified". Does this issue, indicate why the client-side content is failing to update.
if so, any hints would be most welcomed, as to how can I solve this issue.

<script src="../Scripts/jquery-1.6.4.js"></script>
 <script src="../Scripts/jquery-1.6.4.min.js"></script>
 <script src="../Scripts/jquery.signalR-2.1.2.min.js"></script>
 <script src='<%: ResolveClientUrl("~/signalr/hubs") %>'></script>
 <script type="text/javascript">
$(function () {
    // Declare a proxy to reference the hub.          
    var notifications = $.connection.NotificationHub;
    // Create a function that the hub can call to broadcast messages.
    notifications.client.recieveNotification = function (role, descrip) {
        // Add the message to the page.                    
        $('#spanNewMessages').text(role);
        $('#spanNewCircles').text(descrip);            
    };
    // Start the connection.
    $.connection.hub.start().done(function () {
        notifications.server.sendNotifications();
        alert("Notifications have been sent.");

    }).fail(function (e) {
        alert(e);
    });
    //$.connection.hub.start();
});
  </script>
  <h1>New Notifications</h1>
  <div>

  <br />
  <b>New   <span id="spanNewMessages"></span> = role.</b><br />
  <b>New   <span id="spanNewCircles"></span> = descrip.</b><br />   
  </div>


Please advice. Many thanks for your time and help.

Is This A Good Question/Topic? 0
  • +

Replies To: Understand 304 response - not modified?

#2 Dormilich   User is offline

  • 痛覚残留
  • member icon

Reputation: 4303
  • View blog
  • Posts: 13,677
  • Joined: 08-June 10

Re: Understand 304 response - not modified?

Posted 10 October 2014 - 04:35 AM

Quote

I debugged the script using DevTools and discovered my Jquery scripts are responding back as "304 not modified". Does this issue, indicate why the client-side content is failing to update.

yes. but it’s not a client-side failure. to the client it looks as if nothing has changed so it won’t trigger any updates.

you would have to investigate why the server sends a 304 resp. why the requested resource looks the same after the DB update.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1