Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: If-None-Match & Etag

  1. #11
    Sencha User
    Join Date
    Jan 2010
    Posts
    9

    Default

    Condor, thank you for helping me.
    How to remove '_dc' parameter in GET-request?

  2. #12
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    You really need disableCaching:false.

    But you still haven't changed 'defaultHeaders' to 'headers'!

  3. #13
    Sencha User
    Join Date
    Jan 2010
    Posts
    9

    Default

    Next code don't working...
    Code:
     
        var defaultHeaders = {
            'If-None-Match':''
        };
    
        var store = new Ext.data.Store({
            proxy: new Ext.data.HttpProxy({
                url: "/ConnViewProcessing/",
                disableCaching: false, 
                headers: defaultHeaders,
                method:'GET',
                success: function(response, opts) {    
                    Ext.apply(defaultHeaders,{'If-None-Match':response.getResponseHeader('ETag')});},
                   },
                failure: function(response, opts) {
                    //
                }
            }),
            reader: new Ext.data.JsonReader({
                root: 'rows',
                id: 'pk',
                fields: ['pk','name', 'reference']
            }, [
                {name: 'id', mapping: 'pk'},
                {name: 'name', mapping: 'fields.name'},
                {name: 'reference', mapping: 'fields.reference'}
        ])
            //autoLoad: true 
        });
    He always makes a request to the server, but if you delete next line:
    Code:
    Ext.apply(defaultHeaders,{'If-None-Match':response.getResponseHeader('ETag')});},
    request don't makes to server, but data always will be taken in cache to time, without ETag.

  4. #14
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    You indeed can't disable caching, because otherwise it will always get the request from the local cache and doesn't make a server request.

    You either need to switch to using a POST request or your server needs to be able to handle the disableCachingParam in the request.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •