Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
V
vivio-swift
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
9
Issues
9
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wp
vivio-swift
Commits
bf56db5a
Commit
bf56db5a
authored
Feb 01, 2018
by
Jordan Michaels
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update htaccess method
parent
0451845f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
22 deletions
+10
-22
vivio-swift.zip
vivio-swift.zip
+0
-0
vivio-swift/classes/vivio-swift-cache-excludes.php
vivio-swift/classes/vivio-swift-cache-excludes.php
+0
-6
vivio-swift/classes/vivio-swift-cache-onaccess.php
vivio-swift/classes/vivio-swift-cache-onaccess.php
+7
-13
vivio-swift/classes/vivio-swift-utility-htaccess.php
vivio-swift/classes/vivio-swift-utility-htaccess.php
+3
-3
No files found.
vivio-swift.zip
View file @
bf56db5a
No preview for this file type
vivio-swift/classes/vivio-swift-cache-excludes.php
View file @
bf56db5a
...
...
@@ -221,12 +221,6 @@ class Vivio_Swift_Cache_Excludes
}
else
{
$vivio_swift_global
->
debug_logger
->
log_debug
(
"Vivio_Swift_Cache_Excludes::process_cache_excludes() - Forced refresh, skipping cookie checks."
,
1
);
}
/*
if($_COOKIE["comment_author_"]||$_COOKIE["wordpress_logged_in"]||$_COOKIE["wp-postpass_"]||$_COOKIE["wp_woocommerce_session"]){
$vivio_swift_global->debug_logger->log_debug("Vivio_Swift_Cache_Excludes::process_cache_excludes() - Exclude Cookie rule hit [SKIPPING]", 1);
return false;
}
*/
if
(
$vivio_swift_global
->
configs
->
get_value
(
'vivio_swift_cache_exclude_path_is'
)
==
'1'
)
{
...
...
vivio-swift/classes/vivio-swift-cache-onaccess.php
View file @
bf56db5a
...
...
@@ -51,21 +51,9 @@ class Vivio_Swift_Cache_OnAccess
function
create_page_cache
()
{
global
$vivio_swift_global
;
$error
=
''
;
// TODO manually excluded cookies, URI's, useragents, pages
$vivio_swift_global
->
debug_logger
->
log_debug
(
"Vivio_Swift_Cache_OnAccess::create_page_cache() - creating page cache..."
,
0
);
// process exclusions
if
(
!
Vivio_Swift_Cache_Excludes
::
process_cache_excludes
(
$url
)){
// if the url matches one of our excludes, don't cache it, just move on.
$error
=
1
;
}
if
(
$error
==
''
){
$vivio_swift_global
->
debug_logger
->
log_debug
(
"Vivio_Swift_Cache_OnAccess::create_page_cache() - loading page...."
,
0
);
ob_start
(
array
(
$this
,
"create_page_cache_closer"
));
}
ob_start
(
array
(
$this
,
"create_page_cache_closer"
));
}
function
create_page_cache_closer
(
$response
)
...
...
@@ -75,6 +63,12 @@ class Vivio_Swift_Cache_OnAccess
$vivio_swift_global
->
debug_logger
->
log_debug
(
"Vivio_Swift_Cache_OnAccess::create_page_cache_closer() - Initializing closer..."
,
0
);
// process exclusions
if
(
!
Vivio_Swift_Cache_Excludes
::
process_cache_excludes
(
$url
)){
// if the url matches one of our excludes, don't cache it, just move on.
return
$response
;
}
// don't cache certain responses
if
((
function_exists
(
"http_response_code"
))
&&
(
http_response_code
()
!=
200
))
{
...
...
vivio-swift/classes/vivio-swift-utility-htaccess.php
View file @
bf56db5a
...
...
@@ -220,11 +220,11 @@ class Vivio_Swift_Utility_Htaccess
$rules
.
=
'RewriteCond %{REQUEST_URI} \/$'
.
PHP_EOL
;
// ensure a cache file exists
$rules
.
=
'RewriteCond %{DOCUMENT_ROOT}'
.
$parsed_url
[
'path'
]
.
VIVIO_SWIFT_CACHE_URL
.
'
%{REQUEST_URI}
/d/index.html -f [or]'
.
PHP_EOL
;
$rules
.
=
'RewriteCond '
.
VIVIO_SWIFT_CACHE_PATH
.
'd/
%{REQUEST_URI}
/index.html -f'
.
PHP_EOL
;
$rules
.
=
'RewriteCond %{DOCUMENT_ROOT}'
.
$parsed_url
[
'path'
]
.
VIVIO_SWIFT_CACHE_URL
.
'
$1
/d/index.html -f [or]'
.
PHP_EOL
;
$rules
.
=
'RewriteCond '
.
VIVIO_SWIFT_CACHE_PATH
.
'd/
$1
/index.html -f'
.
PHP_EOL
;
// send to cache file
$rules
.
=
'RewriteRule ^(.*) "'
.
$parsed_url
[
'path'
]
.
VIVIO_SWIFT_CACHE_URL
.
'd/
%{REQUEST_URI}
/index.html" [L]'
.
PHP_EOL
;
$rules
.
=
'RewriteRule ^(.*) "'
.
$parsed_url
[
'path'
]
.
VIVIO_SWIFT_CACHE_URL
.
'd/
$1
/index.html" [L]'
.
PHP_EOL
;
// when we need more rules
// $rules .= '' . PHP_EOL;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment