Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions src/traffic_server/InkAPI.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5429,20 +5429,7 @@ TSHttpTxnCacheLookupStatusGet(TSHttpTxn txnp, int *lookup_status)
break;
case HttpTransact::CACHE_LOOKUP_HIT_WARNING:
case HttpTransact::CACHE_LOOKUP_HIT_FRESH:
if (HttpTransact::need_to_revalidate(&sm->t_state)) {
// Note that in this case the object was determined to be fresh but there
// was a problem with the cached object for this request per
// need_to_revalidate(). need_to_revalidate() checks for issues such as
// the need to authenticate with the origin or the incoming request
// method doesn't equal the method of the request for the cached
// response. Issues like this are more accurately described as a MISS
// rather than STALE because they are not due to freshness (timing)
// issues but rather to characteristics that make the cached object
// inappropriate as a response to this request.
*lookup_status = TS_CACHE_LOOKUP_MISS;
} else {
*lookup_status = TS_CACHE_LOOKUP_HIT_FRESH;
}
*lookup_status = TS_CACHE_LOOKUP_HIT_FRESH;
break;
case HttpTransact::CACHE_LOOKUP_SKIPPED:
*lookup_status = TS_CACHE_LOOKUP_SKIPPED;
Expand Down
1 change: 0 additions & 1 deletion tests/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ AM_LDFLAGS += $(TS_PLUGIN_LD_FLAGS)
AM_LDFLAGS += -rpath $(abs_builddir)

include gold_tests/bigobj/Makefile.inc
include gold_tests/cache/plugins/Makefile.inc
include gold_tests/continuations/plugins/Makefile.inc
include gold_tests/chunked_encoding/Makefile.inc
include gold_tests/pluginTest/tsapi/Makefile.inc
Expand Down
30 changes: 2 additions & 28 deletions tests/gold_tests/cache/cache-request-method.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,18 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import os

Test.Summary = '''
Verify correct caching behavior with respect to request method.
'''

# Test 0: Verify correct POST response handling when caching POST responses is
# disabled.
ts = Test.MakeATSProcess("ts")
Test.PrepareTestPlugin(os.path.join(Test.Variables.AtsBuildGoldTestsDir,
'cache', 'plugins', '.libs', 'print_cache_status.so'), ts)
Test.Disk.File(os.path.join(ts.Variables.LOGDIR, 'print_cache_status.log'),
exists=True, content='gold/print_cache_status_cache_post_disabled.gold')
replay_file = "replay/post_with_post_caching_disabled.replay.yaml"
server = Test.MakeVerifierServerProcess("server0", replay_file)
ts.Disk.records_config.update({
'proxy.config.diags.debug.enabled': 1,
'proxy.config.diags.debug.tags': 'http|cache|print_cache_status',
'proxy.config.diags.debug.tags': 'http.*|cache.*',
'proxy.config.http.insert_age_in_response': 0,

# Caching of POST responses is disabled by default. Verify default behavior
Expand All @@ -49,26 +43,14 @@
tr.Processes.Default.StartBefore(ts)
tr.AddVerifierClientProcess("client0", replay_file, http_ports=[ts.Variables.port])

# Wait for log file to appear, then wait one extra second to make sure TS is done writing it.
test_run = Test.AddTestRun()
test_run.Processes.Default.Command = (
os.path.join(Test.Variables.AtsTestToolsDir, 'condwait') + ' 60 1 -f ' +
os.path.join(ts.Variables.LOGDIR, 'print_cache_status.log')
)
test_run.Processes.Default.ReturnCode = 0

# Test 1: Verify correct POST response handling when caching POST responses is
# enabled.
ts = Test.MakeATSProcess("ts-cache-post")
Test.PrepareTestPlugin(os.path.join(Test.Variables.AtsBuildGoldTestsDir,
'cache', 'plugins', '.libs', 'print_cache_status.so'), ts)
Test.Disk.File(os.path.join(ts.Variables.LOGDIR, 'print_cache_status.log'),
exists=True, content='gold/print_cache_status_cache_post_enabled.gold')
replay_file = "replay/post_with_post_caching_enabled.replay.yaml"
server = Test.MakeVerifierServerProcess("server1", replay_file)
ts.Disk.records_config.update({
'proxy.config.diags.debug.enabled': 1,
'proxy.config.diags.debug.tags': 'http|cache|print_cache_status',
'proxy.config.diags.debug.tags': 'http.*|cache.*',
'proxy.config.http.insert_age_in_response': 0,
'proxy.config.http.cache.post_method': 1,
})
Expand All @@ -79,11 +61,3 @@
tr.Processes.Default.StartBefore(server)
tr.Processes.Default.StartBefore(ts)
tr.AddVerifierClientProcess("client1", replay_file, http_ports=[ts.Variables.port])

# Wait for log file to appear, then wait one extra second to make sure TS is done writing it.
test_run = Test.AddTestRun()
test_run.Processes.Default.Command = (
os.path.join(Test.Variables.AtsTestToolsDir, 'condwait') + ' 60 1 -f ' +
os.path.join(ts.Variables.LOGDIR, 'print_cache_status.log')
)
test_run.Processes.Default.ReturnCode = 0

This file was deleted.

This file was deleted.

18 changes: 0 additions & 18 deletions tests/gold_tests/cache/plugins/Makefile.inc

This file was deleted.

89 changes: 0 additions & 89 deletions tests/gold_tests/cache/plugins/print_cache_status.cc

This file was deleted.