class CacheControl

Copyright IBM Corp. 2015

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Public Instance Methods

always_cache_update() click to toggle source

Sets cache_ttl to 0 so cache will update every time

# File lib/cache_control.rb, line 41
def always_cache_update
        @@cache_ttl = 0
end
get_last_accessed_time() click to toggle source
# File lib/cache_control.rb, line 45
def get_last_accessed_time
        @@cache_last_accessed
end
get_ttl() click to toggle source
# File lib/cache_control.rb, line 27
def get_ttl
        @@cache_ttl
end
set_last_accessed_time(time) click to toggle source
# File lib/cache_control.rb, line 49
def set_last_accessed_time(time)
        @@cache_last_accessed = time
end
set_ttl(seconds) click to toggle source
# File lib/cache_control.rb, line 31
def set_ttl(seconds)
        @@cache_ttl = seconds
end
turn_off_cache_update() click to toggle source

Sets cache_ttl to a high number so it never (rarely) updates

# File lib/cache_control.rb, line 36
def turn_off_cache_update
        @@cache_ttl = 9999999999
end