Package ninja.utils

Interface HttpCacheToolkit

    • Method Detail

      • isModified

        boolean isModified​(Optional<String> etag,
                           Optional<Long> lastModified,
                           Context context)
        Checks if resource has been modified. Checks via etag or lastModified when etag not present.
        Parameters:
        etag - - may be absent
        lastModified - - may be absent
        context - the Context of this request
        Returns:
        true if modified / false if not.
      • addEtag

        void addEtag​(Context context,
                     Result result,
                     Long lastModified)
        Adds etag to result.
        Parameters:
        context - The context
        result - The result to populate with etag
        lastModified - Last modified => In that case used to generate etag.